RE: [users@httpd] apache 2.0 as reverse proxy using mod_rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ok I made a mistake in the initial question

When someone goes to https://webserver it has to be redirected to http://webserver-internal/dealer/start

You were right on https://login it has no subdirectory redirect and this works without the rewrite...

I got the following 302 found error from the browser (with header display tool)

HTTP/1.1 302 Found
Date: Fri, 24 Jun 2005 10:43:25 GMT
Server: Apache/1.3.26 (Unix)
Location: http://webserver-internal/dealer/sso/login;DAX_SESSION_COOKIE=C7kFPYZikF3EPG3aKAHBhK2F8JTlnu3lZPk1pcX6A22NluGlzkFK!398064258!175689490!8000!7002
Set-Cookie: DAX_SESSION_COOKIE=C7kFPYZikF3EPG3aKAHBhK2F8JTlnu3lZPk1pcX6A22NluGlzkFK!398064258!175689490!8000!7002; path=/dealer
Content-Type: text/plain; charset=UTF-8
Connection: close
Transfer-Encoding: chunked

So it goes to the right server but it ends at dealer/sso.... With the following rewrite rule in the virtual host webserver:

<VirtualHost ip-address:443>
    ServerAdmin webmaster@webserver
    ServerName webserver
    ProxyPass / http://webserver-internal/
    ProxyPassReverse / http://ip-address/
    SSLEngine on
    SSLCertificateFile /etc/httpd/conf/ssl.crt/webserver.crt
    SSLCertificateKeyFile /etc/httpd/conf/ssl.key/webserver.key
    ErrorLog logs/error_log_webserver
    TransferLog logs/access_log_webserver

    RewriteEngine On
    RewriteRule ^/$ https://webserver/dealer/start [R,L]

</VirtualHost>



-----Original Message-----
From: Axel-Stéphane SMORGRAV [mailto:Axel-Stephane.SMORGRAV@xxxxxxxxxxxxxx] 
Sent: Friday, June 24, 2005 12:04
To: users@xxxxxxxxxxxxxxxx
Subject: RE: [users@httpd] apache 2.0 as reverse proxy using mod_rewrite


OK Here is the deal: Your rewriterule is unnecessary. That's probably what caused the 302.

What your rewriterule does is to send a redirect to https://webserver/ in response to a request for the root path https://webserver/ (or a redirect to https://login/ in response to a request for the root path https://login/).

To me the ProxyPass and ProxyPassReverse directives are sufficient for what you want to achieve. RewriteRule take precedence on ProxyPass. Remove the RewriteRule and it will work.

-ascs

-----Original Message-----
From: Heitmann, Herwarth [mailto:herwarth.heitmann@xxxxxxxxxxxxx] 
Sent: Friday, June 24, 2005 10:01 AM
To: users@xxxxxxxxxxxxxxxx
Subject: RE: [users@httpd] apache 2.0 as reverse proxy using mod_rewrite

Hello,

The configuration of virtual host https://login is the same:

Listen ip-address:443
 
<VirtualHost ip-address:443>
    ServerAdmin webmaster@login
    ServerName webserver
    ProxyPass / http://login-internal/
    ProxyPassReverse / http://login-internal/
    SSLEngine on
    SSLCertificateFile /etc/httpd/conf/ssl.crt/webserver.crt
    SSLCertificateKeyFile /etc/httpd/conf/ssl.key/webserver.key
    ErrorLog logs/error_log_webserver
    TransferLog logs/access_log_webserver
 
    RewriteEngine On
    RewriteRule ^/$ https://login/$1 [R,L]
 
</VirtualHost>

And this is working....

Webserver1 is indeed a typo. I thought $1 is the rest of the parameters. So https://webserver/test supposed to be forwarded to http://webserver-internal/test and will be rewritten back to https://webserver/test

I am probably wrong, but please enlighten me...

Greetings,

Herwarth

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



===========================================================

De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is alleen bestemd voor de geadresseerde. Indien u dit bericht onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct te informeren door het bericht te retourneren. Hoewel Orange maatregelen heeft genomen om virussen in deze email of attachments te voorkomen, dient u ook zelf na te gaan of virussen aanwezig zijn aangezien Orange niet aansprakelijk is voor computervirussen die veroorzaakt zijn door deze email.

The information contained in this message may be confidential and is intended to be only for the addressee. Should you receive this message unintentionally, please do not use the contents herein and notify the sender immediately by return e-mail. Although Orange has taken steps to ensure that this email and attachments are free from any virus, you do need to verify the possibility of their existence as Orange can take no responsibility for any computer virus which might be transferred by way of this email.

===========================================================

---------------------------------------------------------------------
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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux