Web Servers General Talk - Apache reverse proxy replaces host header

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers General Talk > June 2004 > Apache reverse proxy replaces host header





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Apache reverse proxy replaces host header
Horst

2004-06-28, 7:37 pm

Hi,

following is the (simplified) configuration:
Apache 1.3.x configured as reverse proxy as I understand. This proxy
(config sniplet at the end of posting) points to a server in a secure
environment. There is also a DNS-entry resolving 'test.net' to <ip of
reverse proxy>.
The server in the secure environment is a BEA WLS with the deployed
application (e.g. http://test.net/test).
When getting the first page of the application it appears that the
apserver has generated the page with URLs pointing to somewhat like
http://<ip of application>/... which is inacceptable.

I intercepted the request on the machine in the secure environment
(turning wls off):
GET /test
Host: <apserver ip>
X-Forwarded-For: <my browsers ip>
X-Forwarded-Host: test.net
X-Forwarded-Server: test.net
Connection: close

This reveals that the apache reverse proxy moves the host header value
to the X-Forwarded-Host header and inserts the apservers ip as host
value.
As I assume that the wls and other servers generating web pages use
the host header entry for building references the orignial host header
is needed.
Since googling for the X-Forwarded-Host header did not bring up any
usefull information I suppose it is proprietary and not evaluated by
other servers.

So my questions:
- Is there something wrong with the whole configuration or did I do
something wrong?
- Is there any use in replacing the host entry like above? (general
and philosophical question)
- Is there a way to preserve the host header like there is an option
for the actual apache 2.x?

Thanks in advance,

Horst

---------------------------------------------------------------
httpd.conf-sniplet of reverse proxy:
<VirtualHost *:80>
ServerName test.net
ProxyRequests off
ProxyPass / http://<ip of application>/
ProxyPassReverse / http://<ip of application>/
</VirtualHost>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com