change proxy_pass protocol accordingly to x-forwarded-proto

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


Hi,
I have load balancer with SSL on it that connects to nginx servers. Nginx
servers simply reverse proxy site X.com. 
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?
ex:
___________
x-forwarded-proto = https {
    proxy_pass https://X.com
} else {
    proxy_pass http://X.com
}
_______
Thanks for any suggestions

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,252235,252235#msg-252235



More information about the nginx mailing list