[Catalyst] Port on c.req.base behind a caching program

J. Shirley jshirley at gmail.com
Thu Jan 22 14:49:16 GMT 2009

On Thu, Jan 22, 2009 at 3:21 AM, Terence Monteiro
<terence at deeproot.co.in> wrote:
> I'm running a Catalyst application on port x behind varnish on 80 for
> caching. Whenever I call c.req.base or c.uri_for, I get the backend
> server port as a result. I tried setting the using_frontend_proxy option
> in my config, but still I get the backend port.
> I searched the mailing list and found and old thread from 2005,
> http://www.gossamer-threads.com/lists/catalyst/users/1595?search_string=req%20base;#1595
> but can anyone tell me what is the currently the best approach to be
> used? My apache version is 2.2.8-1ubuntu0.3, mod_perl version is
> 2.0.3-2ubuntu2.
> --
> Thanks and Regards,
> Terence Monteiro.
> DeepRoot Linux,
> http://www.deeproot.in
> Ph: +91 (80) 4089 0000
> Getting GNU/Linux to work for you. Faster. Better. Today. Every way

Just so I get what you are saying, you have Varnish -> Apache ->
Mod_Perl -> Catalyst?

If so, you probably just need to set the X-Forwarded-Host parameter in
Varnish to your frontend domain.  In your VCL, add this:

set    req.http.X-Forwarded-Host     = "mysite.com";

I have a Varnish setup here, and it seems to setup everything so I
haven't needed the using_frontend_proxy flag.


More information about the Catalyst mailing list