How to use X-Forwarded-Proto in Nginx Webserver

Viewed 1260

I have set X-Forwarded-Proto to the header. But Nginx as my webserver not using it and always assume the scheme is HTTP, even though I set the X-Forwarded-Proto to HTTPS

How to set Nginx to use X-Forwarded-Proto?

Note: Nginx here as a webserver not a reverse proxy

1 Answers

https://serverfault.com/a/875278/ is the clever way.

Since no https traffic can ever hit my receving vhost though (firewalled off from public net), I've instead set this alongside my fastcgi setup;

fastcgi_param HTTPS 'on';
Related