#1 2016-06-15 20:02:41

Toldierone
Trusted Member
Registered: 2016-06-09
Posts: 40

VirtWire - Append X-Forwarder-For header to HTTP requests

I'd like to suggest enabling haproxy functionality that inserts X-Forwarded-For headers into each HTTP request.
I think it would be useful to know the client's IP address, as due to nature of a reverse proxy, naturally, each and every request has a single the same IP address, aka the address of where the revrse proxy is located (node's external IP).

You can easily confirm that it's  currently not enabled by running

nc -l $yourInternalIP 80

(edit: port 80, since that's the only port haproxy runs on) on your VPS, and then making a request to your external IP/forwarded domain using ordinary webbrowser on your local machine.

I'm not haproxy expert, but according to documentation, it may be as simple as adding

option httpclose
option forwardfor

to the haproxy conf file (in the

frontend main

section of the file? At least that's where I added it to test it on my local machine)

I'd really look forward to see X-Forwarded-For enabled, if it's feasible, of course.

Last edited by Toldierone (2016-06-16 10:30:16)

Offline

Board footer