Mojolicious-Plugin-TrustedProxy
view release on metacpan or search on metacpan
This plugin provides much of the same functionality as setting
"MOJO_REVERSE_PROXY=1", but with more granular control over what headers
to use and what upstream sources can send them. This is especially
useful if your Mojolicious app is directly exposed to the internet, or
if it sits behind multiple upstream proxies. You should therefore ensure
your application does not enable the default Mojolicious reverse proxy
handler when using this plugin.
This plugin supports parsing RFC 7239
<http://tools.ietf.org/html/rfc7239> compliant "Forwarded" headers,
validates all IP addresses, and will automatically convert RFC-4291
IPv4-to-IPv6 mapped values (useful for when your Mojolicious listens on
both IP versions). Please be aware that "Forwarded" headers are only
partially supported. More information is available in "BUGS".
Debug logging can be enabled by setting the "MOJO_TRUSTEDPROXY_DEBUG"
environment variable. This plugin also adds a "remote_proxy_address"
attribute into "Mojo::Transaction". If a remote IP address override
header is matched from a trusted upstream proxy, then
"tx->remote_proxy_address" will be set to the IP address of that proxy.
lib/Mojolicious/Plugin/TrustedProxy.pm view on Meta::CPAN
the application if needed.
This plugin provides much of the same functionality as setting
C<MOJO_REVERSE_PROXY=1>, but with more granular control over what headers to
use and what upstream sources can send them. This is especially useful if your
Mojolicious app is directly exposed to the internet, or if it sits behind
multiple upstream proxies. You should therefore ensure your application does
not enable the default Mojolicious reverse proxy handler when using this plugin.
This plugin supports parsing L<RFC 7239|http://tools.ietf.org/html/rfc7239>
compliant C<Forwarded> headers, validates all IP addresses, and will
automatically convert RFC-4291 IPv4-to-IPv6 mapped values (useful for when your
Mojolicious listens on both IP versions). Please be aware that C<Forwarded>
headers are only partially supported. More information is available in L</BUGS>.
Debug logging can be enabled by setting the C<MOJO_TRUSTEDPROXY_DEBUG>
environment variable. This plugin also adds a C<remote_proxy_address>
attribute into C<Mojo::Transaction>. If a remote IP address override header is
matched from a trusted upstream proxy, then C<< tx->remote_proxy_address >>
will be set to the IP address of that proxy.
( run in 0.516 second using v1.01-cache-2.11-cpan-39bf76dae61 )