Plack::Middleware::Proxy::RewriteLocation
Rewrites redirect headers
- Provided by: libplack-app-proxy-perl (Version: 0.29-1)
- Report a bug
Rewrites redirect headers
use Plack::Builder;
use Plack::App::Proxy;
builder {
enable "Proxy::RewriteLocation";
Plack::App::Proxy->new(remote => "http://10.0.1.2:8080/")->to_app;
};
### or, if mounting (i.e. URLMap) the proxied site at /foo
builder {
enable "Proxy::RewriteLocation", url_map => [ '/foo' => http://10.0.1.2:8080' ];
mount '/foo' => Plack::App::Proxy->new(remote => "http://10.0.1.2:8080/")->to_app;
};
Plack::Middleware::Proxy::RewriteLocation rewrites the "Location" header in the response when the remote host redirects using its own headers, like mod_proxy's "ProxyPassReverse" option.
Tatsuhiko Miyagawa Robert Buels
Plack::App::Proxy