Exposing web UI when using HAProxy and USE_PROXY_PROTOCOL enabled

Hello,

I am using two BunkerWeb workers (Debian bare-metal install, no docker), which site behind HAProxy on my firewall. I am using the standard HAProxy example config that is provided by BunkerWeb: Advanced usages - BunkerWeb documentation.

Sadly, this doesn’t work out of the box and required for me to set USE_REAL_IP and USE_PROXY_PROTOCOL to “yes” in order to get the requests routed by HAProxy.

The problem is that one of the BunkerWeb servers is not only running the worker, but also the UI and scheduler. The Web UI sits behind a hostname that is routed directly to the local IP of the BunkerWeb server on which the UI is running. This means that I bypass HAProxy to access the admin UI panel, which makes sense as not all the workers can serve this backend, only one server.

When I try to access the admin panel (Web UI), I now get my connection reset by BunkerWeb, since I activated the USE_PROXY_PROTOCOL. I interpret this as BunkerWeb or nginx doesn’t want to serve requests NOT being proxied (= not coming from HAProxy).

Is there a solution to this ? I cannot find anything in the documentation stating that USE_PROXY_PROTOCOL is “all-or-nothing” or any example of how to expose the web UI when using load balancing and multiple workers.

Thanks!