Re: [users@httpd] mod_proxy question

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

 



David f. wrote:
David f. wrote:
Hi,


How can I turn ProxyPreserveHost on for for some RewriteRules then off again for some ProxyPass lines in the same vhost? Putting ProxyPreserveHost On before the Rewrites works as expected (turns it on), but when I put the ProxyPreserveHost Off command before the ProxyPass lines, it has no effect, ProxyPreserveHost appears to still be on. It's as if the directive is ignored. Is this the correct behaviour?

The docs are not real clear on this point and there are no entries in bugzilla.

Thanks!

David f.



Hit send too soon, here are the details:

Apache 2.2.2

<VirtualHost 192.168.107.37>
 ServerName www.domain.com
 DocumentRoot /data/domain

 <IfDefine REVERSE_PROXY>
   ProxyPreserveHost On
   RewriteCond %{LA-U:SCRIPT_FILENAME} \.spy$ [NC]
   RewriteRule .* http://192.168.107.37:8080%{REQUEST_URI} [P,L]
   ProxyPassReverse / http://192.168.107.37:8080/
# ProxyPreserveHost Off <--- Uncommenting this causes apache to always redirect back to domain.com!
 </IfDefine>

 <IfModule mod_proxy.c>     ProxyRequests Off
   ProxyPass /fr/forum/ http://forums_fr.domain.com/
   ProxyPassReverse /fr/forum/ http://forums_fr.domain.com/
   ProxyPass /en/forum/ http://forums_en.domain.com/
   ProxyPassReverse /en/forum/ http://forums_en.domain.com/
 </IfModule>

</VirtualHost>


forums_en.domain.com and forums_fr are hosts in a private IP space that is only accessible from the web server. They are defined in the webserver's hosts file.


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





More details. Here are the headers I see:

http://www.domain.com/en/forum/

GET /en/forum/ HTTP/1.1
Host: www.domain.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Referer: http://www.domain.com/en/


HTTP/1.x 301 Moved Permanently
Date: Tue, 18 Jul 2006 13:59:46 GMT
Server: Apache-AdvancedExtranetServer/1.3.31 (Mandrakelinux/7.1.101mdk) PHP/4.3.8 mod_ssl/2.8.19 OpenSSL/0.9.7d
Location: http://www.domain.com/
Content-Type: text/html; charset=iso-8859-1
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked



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