By default, the logging in rest-server will always log the IP address of the connection, which in many cases will be the nearest proxy.
Adding support for the X-Forwarded-For headers will allow the logging to display the correct external IP.
Currently 'gorilla/handlers' is used for logging. 'gorilla/handlers' fully supports decoding the X-Forwarded-For headers if
you add the proxyHeaders middleware before the logging middleware.
I'm currently using the following patch (against master) to implemented the additional middleware:
Hi,
By default, the logging in rest-server will always log the IP address of the connection, which in many cases will be the nearest proxy.
Adding support for the
X-Forwarded-For
headers will allow the logging to display the correct external IP.Currently 'gorilla/handlers' is used for logging. 'gorilla/handlers' fully supports decoding the
X-Forwarded-For
headers if you add theproxyHeaders
middleware before the logging middleware.I'm currently using the following patch (against master) to implemented the additional middleware:
As a result, my logs now show the correct external IP, instead of the IP address of my proxy.
Any thoughts?