httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jérémie G <acesl...@gmail.com>
Subject [users@httpd] proxy and mod_rewrite
Date Thu, 19 Nov 2009 17:19:21 GMT
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 :

<IfModule mod_ssl.c>
<VirtualHost 192.168.172.112:443>
        ServerName test.lan
        ServerAdmin support@test.lan

        SSLEngine On
        SSLCertificateFile    /etc/ssl/certs/ssl-cert-
snakeoil.pem
        SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

        ProxyRequests Off
        <Proxy *>
                Order Deny,Allow
                Allow from all
        </Proxy>

        ProxyPass /test1/ http://test1.lan/
        ProxyPassReverse /test1/ http://test1.lan/
        <Location "/test1.lan/">
                AuthBasicProvider ldap
                AuthType Basic
                AuthName "test1.lan"
                AuthLDAPURL ldap://ldap.lan/dc=example,dc=lan?uid?sub?(uid=*)
                require valid-user
        </Location>

        ProxyPass /test2/ http://test2.lan/
        ProxyPassReverse /test2/ http://test2.lan/
        <Location "/test2.lan/">
                AuthBasicProvider ldap
                AuthType Basic
                AuthName "test2.lan"
                AuthLDAPURL ldap://ldap.lan/dc=example,dc=lan?uid?sub?(uid=*)
                require valid-user
        </Location>

</VirtualHost>
</IfModule>

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 :

                RewriteEngine On
                RewriteCond %{REQUEST_URI} ^/app/MainServlet.*
                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 <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