Can HAProxy detect its own domain?


It is my understanding that the Host field is the Host of the website being requested, correct?

If so, is it possible to get what domain was used to access the HAProxy server?


What do you want to achieve?
Routing based on requested domain to choose the correct backend? Sure thats possible.


I’m using haproxy as a http proxy. I want to be able to create subdomains and route based on my own subdomains.

I’ve done a lot of looking but I think when haproxy is used as a http proxy, it drops its own hostname?

HAProxy is a loadbalancer, not really a proxy. Use squid or tinyproxy. if you want to have a proxy in your client and then connect to the hosts (eg. through firewall etc).
HAProxy is a loadbalancer. Simple use: have haproxy listen to and then route all the incoming traffic to two backend servers which are hosting the website “behind”