Re: [users@httpd] mod_proxy question

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

 



** Resent as the original never made it due to my new e-mail address **

Hi,

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.

You can't turn it on and off within a virtual host - it's either on or
off, end of story.

I have encountered this and worked around it by using a second virtual
server which does preserve the host name, called by the first which
doesn't but it's not pretty and I wouldn't recommend it unless strictly
necessary.

It would be nice to be able to explicitly set the Host: header but that
appears to be overwritten when the request is proxied.

HTH,


				Neil.

-- 
Neil Hillard                    neil.hillard@xxxxxxxxxxxxxxxxxx
Westland Helicopters Ltd.       http://www.whl.co.uk/

Disclaimer: This message does not necessarily reflect the
            views of Westland Helicopters Ltd.


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