I send a request on my backend with header like:
Authorization: Bearer 5b1abab…
But there’s no Authorization header in my $_SERVER variable. I try to print the whole $_SERVER variable and there’s nothing about authorization in there
I’ve tried to add some commands from answers to some familiar questions to my nginx conf file, thats how it looks now:
server {
server_name _;
#...
location / {
proxy_http_version 1.1;
add_header Access-Control-Allow-Origin $http_origin;
add_header Access-Control-Allow-Headers "Authorization";
add_header Access-Control-Allow-Methods *;
proxy_pass http://127.0.0.1:8888/;
proxy_pass_header Set-Cookie;
proxy_pass_header Authorization;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header Authorization $http_authorization;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
listen [::]:80;
listen 80;
But it still doesn’t work
New contributor
HUSH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.