Return IP address of connecting client

Hi All,

I am releatively new to HAProxy but trying to do some new things.

I am looking for a way to use the monitor-uri or another way which I can do a URL check from the remote client to the server, and have the IP address of the client returned. Similar to running “curl ifconfig.co” or using whatismyip.

Example:
Monitor-URI setup as below
monitor-uri /status

Run command
curl url.com: THE URL Shortener - Free, Custom URLs

Returned
HTTP/1.0 200 OK
Cache-Control: no-cache
Connection: close
Content-Type: text/html

I would like the hosting server returning the 200 response to include the public address of the client the curl was run from.

Any way to achieve this would be appreciated.

You can find 2 different solutions here:

1 Like