[plug] Apache Reverse Proxy troubleshooting

Tim Bowden tim.bowden at westnet.com.au
Sun Feb 17 11:27:05 WST 2008

On Sun, 2008-02-17 at 07:13 +0900, mark at ensignexpendable.com wrote:
> Hi Tim,
> My message to the list got caught for moderation so here's a copy direct, I hope it helps.
> -- 
> Mark O'Shea
> ----- Forwarded message from mark at ensignexpendable.com -----
> From: mark at ensignexpendable.com
> To: plug at plug.org.au
> Subject: Re: [plug] Apache Reverse Proxy troubleshooting
> On Sun, Feb 17, 2008 at 12:04:23AM +0900, Tim Bowden wrote:
> > The proxying is working except that the Host HTTP header the proxy is
> > sending the internal server is being set to the ip address of the
> > internal server, rather than the host name being requested by the
> > client.  This results in the internal server serving up the default
> > virtual host, rather than the site requested.
> > 
> > Public proxy virtual host config all looks good to me, but obviously
> > something is dodgy. I've got reverse proxying going to several plone
> > sites and they work fine, but plone has a special setup for handling
> > proxy sites such that they don't rely on the Host HTTP header.
> > 
> > Virtual host config on the reverese proxy (with host names/IP's changed
> > to protect the guilty):
> >  <VirtualHost *>
> >  ServerName site.mydomain.com.au
> >  ProxyRequests Off
> > 
> >  <Proxy *>
> >  Order deny,allow
> >  Allow from all
> >  </Proxy>
> > 
> >  ProxyPass /
> >  ProxyPassReverse /
> >  </VirtualHost>
> > 
> Hi Tim,
> This is the expected behaviour.  Give the internal site a name to help
>  apache decide which site to serve up, even if it's an internal one
>  like myapp.internal (but which the rp can resolve).  Giving apache an
>  ip number and hoping it knows what you mean can be unreliable
>  (whatever plone does).  
> The ProxyPassReverse directive will sort out hiding this from the
>  client on the http level, and your app or webpages should be
>  configured to produce html links giving the real url (if not there is
>  such a thing as mod_proxy_html, but from your description I am
>  thinking you don't need that).
> Regards

Ok, thanks Mark.  I was under the impression for some reason that the
Host header was not changed when doing rp'ing.  I guess I could set up
internal name resolution, but if possible I'd prefer to munge the Host
HTTP header sent by the rp to be the same as in the initial request. I
believe that would also solve the problem, unless there's a good reason
why this is a bad idea.  Anyone able to point me in the right direction
for that?

Tim Bowden

More information about the plug mailing list