[Catalyst] Anyone using ProxyPass?
Richard Jones
ra.jones at dpw.clara.co.uk
Wed Jul 4 22:44:12 GMT 2007
Richard Jones wrote:
> However, the URLs constructed in the templates from Catalyst.uri_for
> pick up the port number, thus defeating the idea of ProxyPass. In one of
Replying to my own post, but for the benefit of closure, and for anyone
else who might stumble over this one in future, I've fixed it.
The main reason for the apparent failure to remove the backend server
port from uri_for was that the $host variable in
Catalyst::Engine::Apache::prepare_path ($self->apache->hostname) was set
to the IP address of the backend server, not localhost/127.0.0.1. So
PROXY_CHECK was skipped and the requesting url + port were passed
through unchanged as $host for eventual inclusion in $c->request->uri
and $c->request->base. Easily fixed by setting using_frontend_proxy => 1
in the app config.
The clues were all there had I but realised - the lack of
X-Fowarded-Host was a red-herring as I was looking at the result of
requests made with url's containing the backend port, so of course it
wasn't set! We live and learn.
--
Richard Jones
More information about the Catalyst
mailing list