1 package Catalyst::TraitFor::Request::ProxyBase;
3 use namespace::autoclean;
8 my ($orig, $self, @args) = @_;
9 my $ret = $self->$orig(@args);
11 # FIXME - Mangle here.
21 Catalyst::TraitFor::Request::ProxyBase -
27 use namespace::autoclean;
30 use CatalystX::RoleApplicator;
34 __PACKAGE__->apply_request_class_roles(qw/
35 Catalyst::TraitFor::Request::ProxyBase
38 __PACKAGE__->config( using_frontend_proxy => 1 );
43 This module is a L<Moose::Role> which allows you more flexibility in your
44 application's deployment configurations when deployed behind a proxy.
46 The problem is that there is no standard way for a proxy to tell a backend
47 server what the original URI for the request was, or if the request was
48 initially SSL. (Yes, I do know about C<< X-Forwarded-Host >>, but they don't
51 This creates an issue for someone wanting to deploy the same cluster of
52 application servers behind various URI endpoints.
54 Using this module, with the C<< using_frontend_proxy >> configuration
55 directive activates it's behavior. The request base (C<< $c->req->base >>)
56 is replaced with the contents of the C<< X-Request-Base >> header,
57 which is expected to be a full URI, for example:
61 http://other.example.com:81/foo/bar/yourapp
63 This value will then be used as the base for uris constructed by
66 =head1 REQUIRED METHODS
74 =head1 WRAPPED METHODS
82 Probably. Patches welcome, please fork from:
84 http://github.com/bobtfish/catalyst-traitfor-request-proxybase
86 and send a pull request.
90 Tomas Doran (t0m) C<< <bobtfish@bobtfish.net> >>
94 This module is Copyright (c) 2009 Tomas Doran and is licensed under the same