[Django]-Amazon ELB + Django HTTPS issues

6👍

Just add

proxy_set_header X-Forwarded-Proto https; 

in your nginx config. Your nginx will always be serving the clients using https as the ELB is configured to receive https traffic.

Also the reason $scheme may not have worked is because your nginx is still on http protocol and not https protocol

0👍

proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $proxy_x_forwarded_proto;

Leave a comment