[Catalyst] Anyone using ProxyPass?

Bill Moseley moseley at hank.org
Sat Jun 30 14:20:28 GMT 2007

On Sat, Jun 30, 2007 at 11:56:44AM +0100, Richard Jones wrote:
> Thanks to many on this list I have managed to get my app running on 
> Apache/mod_perl (a permissions issue), and have followed the Cookbook 
> example of using Apache for static files and Apache/mod_perl for the 
> dynamic content, and using ProxyPass/ProxyPassReverse in the static 
> server. I know this is working OK from the browsers' address bar.

You should not need to use ProxyPassReverse is using $c->uri_for for

> However, the URLs constructed in the templates from Catalyst.uri_for 
> pick up the port number, thus defeating the idea of ProxyPass.

You mean uri_for is generating links showing the port of the back end
Catalyst server?

Catalyst::Engine::Apache looks at X-Forwarded-Host header to set the host and
port for the request object:

        $host = $c->request->header( 'X-Forwarded-Host' );

        if ( $host =~ /^(.+):(\d+)$/ ) {
            $host = $1;
            $port = $2;

Which ends up setting the request base, which is used in uri_for.

Is your front end machine on the same host? If not you would likely need to
set $c->config->{using_frontend_proxy} per the docs.

Bill Moseley
moseley at hank.org

More information about the Catalyst mailing list