change proxy_pass protocol accordingly to x-forwarded-proto

confiq nginx-forum at
Sun Aug 3 07:55:57 UTC 2014

I have load balancer with SSL on it that connects to nginx servers. Nginx
servers simply reverse proxy site 
The problem is that nginx servers don't have SSL certs and listing only to
unsecured port but it forwards to https protocol. 
The question is, can I change proxy_pass URL accordingly to
x-forwarded-proto header?
x-forwarded-proto = https {
} else {
Thanks for any suggestions

Posted at Nginx Forum:,252235,252235#msg-252235

More information about the nginx mailing list