I would like to pass the environment variable REMOTE_USER set by apache when HTTP basic authentication is correct to a backend. This would provide authentication to the backend server as well.
Here is my apache2 configuration file:
<Directory />
AuthType basic
AuthUserFile $my_file
require valid-user
RewriteEngine on
RewriteCond %{REMOTE_USER} (.+)
RequestHeader set X-Forwarded-User %{REMOTE_USER}e
</Directory>
Authentication by apache2 goes well, as I am properly redirected to the backend server, but then, backend server does not receive the REMOTE_USER as the X-Forwarded-User variable does not appear in tcpdump trace.
What may I have forgotten/misconfigured which does not let this REMOTE_USER variable being forwarded to backend as X-Forwarded-User?