httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "O┬┤Hehir,Oliver" <Oliver.OHe...@tre.se>
Subject [users@httpd] Rewrite a URL and then ProxyPass it?
Date Mon, 03 Mar 2003 16:19:10 GMT
Hej!

Is it possible to do the following? Rewrite a client's URL with the REMOTE_USER as a request
parameter on the URL, and then pass this rewritten URL through a proxy for a backend server,
i.e. the client (johndoe) sees that his submitted URL has changed from http://frontEndHost/webApp
to http://frontEndHost/webApp?REMOTE_USER=johndoe, but doesn't see that his request actual
goes to a backend webserver as http://backEndHost/webapp?REMOTE_USER=johndoe. 

Note: the front end server has basic authentication on, which would make REMOTE_USER available.


My configuration in httpd.conf:
RewriteEngine on
RewriteRule ^/webApp(.*)$  /webApp$1?REMOTE_USER=%{REMOTE_USER}&%{QUERY_STRING} [P]

ProxyRequests On
ProxyPass /webApp/ http://backEndHost/webapp
ProxyPassReverse /webApp/ http://backEndHost/webapp


Does the fact that mod_rewrite is after mod_proxy (see below) in the configuration mean rewrite
gets called before proxy?

$ ../bin/httpd -l
Compiled in modules:
  core.c
  mod_access.c
  mod_auth.c
  mod_include.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  mod_proxy.c
...
  mod_rewrite.c
 

Thanks in advance!

Oliver.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message