Prevent nginx from redirecting traffic from https to http when used as a reverse proxy
- by Chris Pratt
Here's my abbreviated nginx vhost conf:
upstream gunicorn {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;
listen 443 ssl;
server_name domain.com ~^.+\.domain\.com$;
location / {
try_files $uri @proxy;
}
location @proxy {
proxy_pass_header Server;
proxy_redirect off;
…