Reputation: 85
I am proxying requests from server A (Apache 2.4) to server B (Apache 2.2) as following:
RequestHeader set X_REMOTE_USER %{REMOTE_USER}s
ProxyPass / https://www.server_b.com/
ProxyPassReverse / https://www.server_b.com/
When I print the environment variables on server B, I see HTTP_X_REMOTE_USER
. However, when I do the same proxying to server C (Apache 2.4), apache doesn't set an environment variable with that name.
It appears that going from 2.2 to 2.4 some of the environment variables set from request headers are no longer being set. Is this correct? If so, how do I make 2.4 work like 2.2?
Upvotes: 0
Views: 617
Reputation: 7835
You can use SetEnvIf
to set an environment variable based on a request header. For example:
SetEnvIf X_REMOTE_USER "^(.*)$" HTTP_X_REMOTE_USER=$1
Upvotes: 1