Any way to present client origination hostname to backend


#1

I am new to haproxy.
I am deploying haproxy to route client connections for a specific port to my backend server running on a different port.
The backend server sees all clients have been originated on the same host.

Is there any configuration most likely in “default” or “front end” to pass the client hostname to the backend server.

Any help is appreciated.

Thanks
MPaul


#2

Hi,

your question is unclear. What do you mean by “client hostname” ?


#3

inside haproxy I wish to view what clients are connected and from what hostname!

quite like the " ss -at |grep port " ouput but inside hapropxy.

I tried the haproxy status page but it has no such details … atleast the webpage.


#4

yes, it is possible but need to bind the port for frontend and backend on same IP but different port number


#5

Please help confirm if you meant the following I did !

#---------------------------------------------------------------------

main frontend which proxys to the backends for mysql default port 3306

#---------------------------------------------------------------------

frontend MyFrontend
option tcplog
option logasap
bind 192.xxx.xxx.xxx:3306
default_backend TransparentBack

#---------------------------------------------------------------------

static backend for serving up data

#---------------------------------------------------------------------

backend TransparentBack
mode tcp
server mysql 192:xxx.xxx.xxx:3309 maxconn 1000


#6

Hi,
Yes it should work.


Thanks
Sandeep


#7

Thanks… but the status webpage does not show any frontend client list atall.

it does show some linkages for the “frontend” but no details…

Is it because we use tcplog !


#8

sample snip output attached

remember we are not routing web clients these are std mysql tcp clients being switched to a new port