[Catalyst] Re: [Catalyst-dev] Trouble with ProxyPass

Tomas Doran bobtfish at bobtfish.net
Mon Jun 17 17:35:11 GMT 2013


Hi Jillian.

You wanted the Catalyst list, not the dev list - the dev list is for the development of Catalyst itself :)

On 17 Jun 2013, at 12:44, Jillian Rowe <jir2004 at qatar-med.cornell.edu> wrote:

> Hello,
> 
> I'm having trouble getting my application running under ProxyPass using
> Apache. I'm not entirely sure if it my worries lie in catalyst or
> apache. I do have another application (not catalyst) which uses
> proxypass with the exact same SSL config and its fine.
> 
> It will display pages fine, but when I go to submit a form I get the
> following:
> 
> "Although this page is encrypted, the information you have entered is to
> be sent over an unencrypted connection and could easily be read by a
> third party.
> 

This is as URIs in your form are being generated as http://, not https://

> Are you sure you want to continue sending this information?"
> 
> 
> This is what my apache config looks like:
> 
> 
>        ProxyRequests On
>        ProxyVia On
>        ProxyReceiveBufferSize 16384
>        <Location />
>                ProxyPass http://127.0.0.1:3000/
>                ProxyPassReverse http://127.0.0.1:3000/
>                SetEnv force-proxy-request-1.0 1
>                SetEnv proxy-nokeepalive 1
> 
>                SSLRequireSSL
>                SetHandler perl-script
>                RequestHeader set X-URL-SCHEME https

You want:

RequestHeader set X-Forwarded-HTTPS ON


>                Order allow,deny
>                Allow from all
>        </Location>
> 
> I have $c->config->{using_frontend_proxy} = 1.
> 

And also this setting to get Plack::Middleware::ReverseProxy loaded (see the source code for that for the why I think you need the other header)

> My application works fine if I just do localhost:3000, and it also works
> fine when I run it as a fastcgi application. I do not get the security
> warning when running either under development or fastcgi.
> 
> I am looking into using the proxypass option solely for development. I
> am working on an application that uses very big data and log into a
> virtualbox for it. I have several file locations that are references to
> urls.
> 
>  Alias /bigdata /data/share/web_public/bigdata
>        <Directory /data/share/web_public/bigdata>
>           AllowOverride All
>           Options Indexes MultiViews FollowSymLinks
>           order Allow,Deny
>           Allow from all
>        </Directory>
> 
> So I need something happening with apache I think. Is there anyway to
> get Catalyst to alias those paths for me?

Yes! You can do that quite easily :)

If you make a controller responsible for those paths, then you can just use the static file plugin to serve them.. E.g.

package MyApp::Controller::BigData;
use Moose;
use namespace::autoclean;

BEGIN { extends 'Catalyst::Controller' }

sub bigdata: Chained('/') Args {
    my ($self, $c, @path) = @_;
    # This method comes from Catalyst::Plugin::Static::Simple
    $c->serve_static_file('/data/share/web_public/bigdata/' . join('/', @path));
}

I've just mashed this out on the bus - so debugging/fixing will surely be needed - but something fairly close to this should work!

> 
> I have really been making my head explode over this, and help would be
> very appreciated!!!


Good luck! If you're still struggling then hopping on irc and asking for help could be your best (fastest) way to resolve.

Cheers
t0m




More information about the Catalyst mailing list