I'm chainging my setup from
nginx > apache/php
to
haproxy > nginx > apache/php
(using haproxy 1.5-dev18 with ssl support compiled in)
Both nginx and haproxy are setup correctly to set the HTTP_X_FORWARDED_PROTO header. However, when nginx gets the ssl traffic from haproxy, it sees the connection as http and sets the header as so.
How can I set nginx to forward the HTTP_X_FORWARDED_PROTO header if it exists, but otherwise continue setting it based on the connection?