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 RE: [users@httpd] RE: Rewrite a URL and then ProxyPass it?
Date Wed, 05 Mar 2003 14:31:17 GMT
Unfortunately, thats not the problem :-( I was just trying to see if I could read other env
variables like REMOTE_HOST, which I can, and then forgot to change it back to REMOTE_USER,
which still won't work. Sorry about that.

Oliver.

-----Original Message-----
From: Boyle Owen [mailto:Owen.Boyle@swx.com]
Sent: den 5 mars 2003 15:27
To: users@httpd.apache.org
Subject: RE: [users@httpd] RE: Rewrite a URL and then ProxyPass it?




>-----Original Message-----
>From: "O´Hehir,Oliver" [mailto:Oliver.OHehir@tre.se]
>Sent: Mittwoch, 5. März 2003 15:05
>To: users@httpd.apache.org
>Subject: [users@httpd] RE: Rewrite a URL and then ProxyPass it?
>
>
>Help! 
>
>REMOTE_USER is still missing when I rewrite the URL. Can 
>anyone shed some light as it is missing? 
>
>I thought that once I protected the Proxy with security then 
>REMOTE_USER would become available for use. I know that the 
>REMOTE_USER is logged in the access log file, but it never 
>appears in the rewrite log file. Any suggestions would be very 
>appreciated!
>
>Oliver.
>
>PS.
>This is my httpd.conf:
>
># Rewrite settings
><IfModule mod_rewrite.c>
>	RewriteEngine on
>	RewriteLog logs/rewrite.log
>	RewriteLogLevel 9
># If the REMOTE_USER env var is present, then append it to the URL
># ^.*$ means search for 1 to X characters
>	RewriteCond %{REMOTE_USER}   ^.+$
>	RewriteRule ^/webApp_proxy/(.*)$  
>http://1.1.1.1:7005/webApp/$1?REMOTE_USER=%{REMOTE_HOST}&{QUERY
                                             ^^^^^^^^^^^
Err... This is REMOTE_HOST, not REMOTE_USER  ^^^^^^^^^^^

Is that it?

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 

>_STRING} [P]
># If the REMOTE_USER env var is not present, then don't append 
>it to the URL
>	RewriteCond %{REMOTE_USER}   !^.+$
>	RewriteRule ^/webApp_proxy/(.*)$  
>http://1.1.1.1:7005/webApp/$1 [P]
></IfModule>
>
>#Proxy settings
><IfModule mod_proxy.c>
>ProxyRequests On
>ProxyPassReverse /webApp_proxy/ http://1.1.1.1:7005/webApp/
>
><Proxy *>
>    Order deny,allow
>    Deny from all
>    Allow from all
>    AuthType Basic
>    AuthName "Password Required"
>    AuthUserFile password.file
>    AuthGroupFile group.file
>    require group usergroup
></Proxy>
></IfModule>
># End of proxy directives.
>
>
>
>
>And this is what I get from my access and rewrite log:
>
>... unauthenticated users makes a request...
>
>(2) init rewrite engine with requested uri /webApp_proxy/
>(3) applying pattern '^/webApp_proxy/(.*)$' to uri '/webApp_proxy/'
>(4) RewriteCond: input='' pattern='^.+$' => not-matched
>(3) applying pattern '^/webApp_proxy/(.*)$' to uri '/webApp_proxy/'
>(4) RewriteCond: input='' pattern='!^.+$' => matched
>(2) rewrite /webApp_proxy/ -> http://1.1.1.1:7005/webApp/
>(2) forcing proxy-throughput with http://1.1.1.1:7005/webApp/
>(1) go-ahead with proxy request proxy:http://1.1.1.1:7005/webApp/ [OK]
>"GET /webApp_proxy/ HTTP/1.1" 401 485
>
>...the user,Testuser1, enters username and password...
>
>(2) init rewrite engine with requested uri /webApp_proxy/
>(4) RewriteCond: input='' pattern='^.+$' => not-matched
>(3) applying pattern '^/webApp_proxy/(.*)$' to uri '/webApp_proxy/'
>(4) RewriteCond: input='' pattern='!^.+$' => matched
>(2) rewrite /webApp_proxy/ -> http://1.1.1.1:7005/webApp/
>(2) forcing proxy-throughput with http://1.1.1.1:7005/webApp/
>(1) go-ahead with proxy request proxy:http://1.1.1.1:7005/webApp/ [OK]
>Testuser1 "GET /retail_proxy/ HTTP/1.1" 502 316
>
>
>
>
>
>
>-----Original Message-----
>From: O´Hehir,Oliver 
>Sent: den 3 mars 2003 17:19
>To: 'users@httpd.apache.org'
>Subject: Rewrite a URL and then ProxyPass it?
>
>
>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

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 



---------------------------------------------------------------------
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


---------------------------------------------------------------------
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