I want to capture client hostname into HaProxy log. Using the help at
HAProxy Log Customization
I am able to customize log format. But not able to capture client hostname (I mean requesting client hostname) . Any idea how to capture that? Thanks in advance.
Regards.
Nimesh
Where or how exactly would you like to get the clients hostname? It’s not like the client is sending it in the HTTP request.
If you are thinking about doing a reverse lookup of the client’s IP address, this cannot work; because logging needs to be fast, you cannot wait for a external DNS lookup to log a request.
I would recommend to do this not in haproxy, but in some kind of post processing script/automation.
Thanks lukastribus, you are absolutely right. My purpose is to authenticate client based on their requesting hostnames. Actually multiple clients are sending auth requests
from a single shared IP, So, authentication based on source IP will not works. Moreover, clients are using Python Selenium to make proxy requests which is not supports user:pass@proxyip:port format
.
Any other way of solution idea?