Plack::Middleware::ForwardedHeaders - Use headers from reverse proxy
use Plack::Builder; builder { enable 'ForwardedHeaders'; $app; };
Uses forwarded headers to determine remote IP address, HTTPS status, and requested host. It will adjust the REMOTE_ADDR, HTTP_HOST, and psgi.url_scheme environment items accordingly.
REMOTE_ADDR
HTTP_HOST
psgi.url_scheme
WARNING: Enabling this middleware without a reverse proxy or a properly configured list of trusted proxies will allow users to spoof their IP address.
An IP address or an array reference of IP addresses of trusted proxies. If set, the forwarded headers will only be used if the request comes from one of the addresses listed as trusted.
If set, forwarded headers will be used to determine the host being requested. Defaults to false.
If set, forwarded headers will be used to determine the URL scheme. Defaults to true.
If set, forwarded headers will be used to determine the client address. Defaults to true.
If set, the hostname of the client will be resolved and saved in the REMOTE_HOST. Defaults to false.
The folling headers are used to determine the original requested host for a forwarded request.
Set by Apache 2.2
The folling headers are used to determine the remote IP address for a forwarded request.
The de-facto standard for finding the originating client IP address. Set by Squid, Apache 2.2, and many others.
Used by nginx.
The folling headers are used to determine the forwarded scheme:
Used by Microsoft Internet Security and Acceleration Server
http://en.wikipedia.org/wiki/X-Forwarded-For
Graham Knop <haarg@haarg.org>
Copyright (c) 2010, Graham Knop
This library is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.
To install Plack::Middleware::ForwardedHeaders, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::ForwardedHeaders
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::ForwardedHeaders
For more information on module installation, please visit the detailed CPAN module installation guide.