Extension Name: Trust X-Forwarded-For
Author: martti
Extension Description: Logging of user IPs from the
X-Forwarded-For
HTTP header when using a reverse proxy which is under your control (and can trust it sets the X-Forwarded-For
header correctly).The
X-Forwarded-For
header value is a comma and space separated list of IP addresses, the left-most being the original client, and each successive proxy that passed the request adding the IP address where it received the request from.This extension will set the user ip in your phpBB to the most trusted (most right) ip in the
X-Forwarded-For
header instead of REMOTE_ADDR
(the direct client) Use this only with a reverse proxy which is under your control. This extension will block all ips which are not localhost (127.0.0.1
or ::1
) unless defined in the environment variable MARTTIPHPBB_TRUSTXFORWARDEDFOR_IPS
which can be a comma separated list of ip addresses.If your reverse proxy has i.e the address
172.17.0.13
, then set the environment variable MARTTIPHPBB_TRUSTXFORWARDEDFOR_IPS=172.17.0.13
Extension Version: 0.1.5
Requirements:
- phpBB 3.2+
- PHP 7+
ext/marttiphpbb/trustxforwardedfor
Github repository: https://github.com/marttiphpbb/phpbb-ex ... rwardedfor
Languages: no language files included
Templates: no template files included
Screenshots:
In the admin log:
172.17.0.1
is the address of my reverse proxy and 109.129.122.208
was my own ip yesterday. Without the extension every users' ip would always show
172.17.0.1
Note: I purged the cache and enabled the extension with the CLI, that's why the user is Anonymous there.