ForwardedHeaderSupport
The ForwardedHeaderSupport plugin (previously known as feature) allows you to handle reverse proxy headers to get information about the original request when it's behind a proxy.
ForwardedHeaderSupporthandles the standardForwardedheader (RFC 7239)XForwardedHeaderSupporthandles the non-standard (but standard de-facto)X-Forwarded-Host/X-Forwarded-Server,X-Forwarded-For,X-Forwarded-By,X-Forwarded-Proto/X-Forwarded-ProtocolandX-Forwarded-SSL/Front-End-Https
Usage
These plugins don't require any special configuration. You can install any of the two depending on your reverse proxy, but since the standard is the Forwarded header, you should favor it whenever possible.
or
Request information
You can see all the available request properties on the Requests page.
The proxy request information
You can read the raw or local request information, read from the received normal headers and socket properties, that correspond to the proxy request using the request.local property:
The original request information
You can read the original request information, read from the Forwarded or X-Forwarded-* headers with fallback to the raw headers, that corresponds to original client request using the request.origin property:
In the cases where you need the X-Forwarded-By (the interface used for the socket), you can access the raw X-Forwarded properties with:
Header description
The standard Forwarded header looks like this:
Forwarded: by=<identifier>; for=<identifier>; host=<host>; proto=<http|https>
by- The interface where the request came in to the proxy server.for- The client that initiated the request and subsequent proxies in a chain of proxies.host- The Host request header field as received by the proxy.proto- Indicates which protocol was used to make the request (typically "http" or "https").