Kyle Decot
Kyle Decot

Reputation: 20815

Debug Environment Variables in Apache VirtualHost

I'm using ProxyPass while attempting to set a request header in my vhost w/:

<VirtualHost *:443>
    ...
    RequestHeader set X-REMOTE-USER "%{REMOTE_USER}s"
    ProxyPass / http://127.0.0.1:9292/
    ProxyPassReverse / http://127.0.0.1:9292/
    ...
</VirtualHost>

However when inspecting the headers that are getting sent to my application running on port 9292 I see:

"HTTP_X_REMOTE_USER"=>"(null)" 

Does this mean that REMOTE_USER is not set or am I using RequestHeader incorrectly? Is there a way to debug what environment variables I have available to me within the vhost?

Upvotes: 2

Views: 2372

Answers (1)

Dario
Dario

Reputation: 4035

The problem is that, those variables are available for mod_rewrite but not to mod_headers.

Here you can found a complete answer to a similar problem:

To get a list of all available enviroment variables you can use printenv command in the server, or browse this list of common enviroment variables.

Upvotes: 4

Related Questions