Plack-Middleware-ReverseProxyPath

 view release on metacpan or  search on metacpan

lib/Plack/Middleware/ReverseProxyPath.pm  view on Meta::CPAN

Plack::Middleware::B<ReverseProxyPath> adds handling of paths.

The goal is to allow proxied back-end apps to reconstruct and use
the client-facing url.  ReverseProxy does most of the work
and ReverseProxyPath does the paths.  The inner app can simply
use $req->base to redirect, set cookies and the like.

I find the term B<reverse proxy> leads to confusion, so I'll
use B<front-end> to refer to the reverse proxy (eg. squid) which
the client hits first, and B<back-end> to refer to the server
that runs your PSGI application (eg. starman).

Plack::Middleware::ReverseProxyPath adjusts SCRIPT_NAME and PATH_INFO
based on headers from a front-end so that it's inner app can pretend
there is no proxy there.  This is useful when you aren't proxying and
entire server, but only a deeper path.  In Apache terms:

  ProxyPass /mirror/foo/ http://localhost:5000/bar/

It should be used with Plack::Middleware::ReverseProxy which does equivalent
adjustments to the scheme, host and port environment attributes.



( run in 0.309 second using v1.01-cache-2.11-cpan-e93a5daba3e )