I am using apache 2.4 and trying to use the environment variable inside the conf file for proxy pass. There is a thread [ Apache proxypass using the URL of the variable with interpolation ], saying this:
RewriteEngine on
RewriteMap lowercase int:tolower
RewriteRule ^ - [E=SERVER_NAME:${lowercase:%{SERVER_NAME}}]
ProxyPassInterpolateEnv On
ProxyPass / ajp://${SERVER_NAME}:8009/ interpolate
ProxyPassReverse / ajp://${SERVER_NAME}:8009/ interpolate
But when I tried this myself, I get the error "AH00111: Config variable $ {SERVER_NAME} not defined". This means that Apache2.4 considers the variable $ {SERVER_NAME} as a configuration variable, not an environment variable.
I also tried using mod_rewrite sytax for a variable like this,
ProxyPass / ajp://%{ENV:SERVER_NAME}:8009/ interpolate
ProxyPassReverse / ajp://%{ENV:SERVER_NAME}:8009/ interpolate
But% {ENV: SERVER_NAME} was treated as a plaintext string and generated an error, since this is not a valid URL.
"" . , SERVER_NAME mod_rewrite.
mod_rewrite [P], ProxyPassReverse, . mod_rewrite ProxyPassReverse.
, confipass confyp?