proxy and mod_rewrite

proxy and mod_rewrite

am 19.11.2009 18:19:21 von aceslash

Hello everyone,

I'm currently trying to allow access to several internal website on
one main https external website (the proxy server is using httpd
version "2.2.9-10+lenny6"). Bellow is my test vhost :



      =A0 ServerName test.lan
      =A0 ServerAdmin support@test.lan

      =A0 SSLEngine On
      =A0 SSLCertificateFile  =A0 /etc/ssl/certs/ssl-cert-
snakeoil.pem
      =A0 SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snake=
oil.key

      =A0 ProxyRequests Off
      =A0
              =A0 Order Deny,Allow
              =A0 Allow from all
      =A0


      =A0 ProxyPass /test1/ http://test1.lan/
      =A0 ProxyPassReverse /test1/ http://test1.lan/
      =A0
              =A0 AuthBasicProvider ldap
              =A0 AuthType Basic
              =A0 AuthName "test1.lan"
              =A0 AuthLDAPURL ldap://ldap.lan/d=
c=3Dexample,dc=3Dlan?uid?sub?(uid=3D*)
              =A0 require valid-user
      =A0


      =A0 ProxyPass /test2/ http://test2.lan/
      =A0 ProxyPassReverse /test2/ http://test2.lan/
      =A0
              =A0 AuthBasicProvider ldap
              =A0 AuthType Basic
              =A0 AuthName "test2.lan"
              =A0 AuthLDAPURL ldap://ldap.lan/d=
c=3Dexample,dc=3Dlan?uid?sub?(uid=3D*)
              =A0 require valid-user
      =A0





Everything is working fine except that on some internal website, there
is hard coded request like "/app/MainServlet" and the result of that
request url is "https://test.lan/app/MainServlet" where I want
"https://test.lan/test1/app/MainServlet",
"https://test.lan/test2/app/MainServlet", etc

I've tried some rewrite rule like :

              =A0 RewriteEngine On
              =A0 RewriteCond %{REQUEST_URI} ^/=
app/MainServlet.*
              =A0 RewriteRule ^(.*)$ https://%{=
SERVER_NAME}/test1%{REQUEST_URI}

But the issue is that several website have the same request
hardcoded... with this kind of rule, both test1 and test2
"/app/MainServlet" location point toward
"https://test.lan/test1/app/MainServlet".

My idea was to look for the url from which the client came from, but I
didn't find any parameters like this in the documentation of
mod_rewire...

Any idea will be highly appreciated.

Regards,
Ace

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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

Re: proxy and mod_rewrite

am 19.11.2009 18:25:35 von Nick Kew

On 19 Nov 2009, at 17:19, J=E9r=E9mie G wrote:
> Any idea will be highly appreciated.

http://www.apachetutor.org/admin/reverseproxies

--=20
Nick Kew

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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