Basically I want to do the opposite of this question: Sending machine hostname as a header in Apache
A header in the request (say "OIDC_CLAIM_nickname") contains a hostname. I want to proxy the request to hostname.somedomain.com
How do I do this?
EDIT:
This is what I tried:
LogFormat "%{OIDC_CLAIM_nickname}i"
RewriteEngine on
RewriteMap lowercase int:tolower
RewriteRule ^ - [E=NICK_NAME:${lowercase:%{OIDC_CLAIM_nickname}}]
ProxyPassInterpolateEnv On
<Location "/">
AuthType openid-connect
Require valid-user
ProxyPass http://${NICK_NAME}.somedomain.com/ interpolate
ProxyPassReverse http://${NICK_NAME}.somedomain.com/ interpolate
</Location>
But it doesn't work. In the access log I see the OIDC_CLAIM_nickname header value but in the error log I see Apache is trying to resolve ".somedomain.com", i.e. the variable name is empty.