I have Apache set up as a load balancer. I wanted to make apache set the X-Forwarded-Proto header, but this doesn't work:
RequestHeader set X-Forwarded-Proto "%{SERVER_PROTOCOL}e"
The header gets set to null. Any idea why?
|
I have Apache set up as a load balancer. I wanted to make apache set the X-Forwarded-Proto header, but this doesn't work:
The header gets set to null. Any idea why? | |||
|
feedback
|
|
You don't want that; it'd set your header to "HTTP/1.1" (even on an https request) - probably not terribly useful to whatever you're passing to. You have different VirtualHost blocks for http and https; just hardcode the
| |||
feedback
|
|
Found the cause. Turns out it is an order of operations issue. mod_rewrite is responsible for supplying these environment variables, but Apache doesn't process it until AFTER it handles any ProxyPass requests. Until then, it will just set null. The only workaround appears to be to do the proxying via mod_rewrite. See http://www.gossamer-threads.com/lists/apache/users/267160?do=post_view_threaded#267160 | |||
|
feedback
|