HAProxy: Configure an HTTP Frontend for Dual-Port Listening

Configured an HAProxy HTTP frontend to bind ports 80 and 8081. Port 8081 isn’t active. My sample config:

frontend web_front :9000
  bind :80,:8081
  mode http
  default_backend web_bck

backend web_bck
  server srv1 localhost:8081 check

Any suggestions?

hey, im not 100% sure but comma binding might be causing issues. have u tried splitting the binds? also, double-check firewall settings and reload config. what results do u get?

hey haz_45writ, maybe try listing bind commands on separate lines. also, did u spot any errors in the logs? im curious if any other process is interfering with port 8081. have u tried restarin the service?

hey, try binding each ip individually instead of a comma list. also, double-check if iptables arent blocking 8081. i had a similar issue before, so splitting the binds solved it for me. let me knw how it goes u.

The configuration appears similar to typical examples, yet an issue might arise from permission problems if HAProxy is running as a non-root user. In my experience, ensuring that the process has sufficient privileges to bind to lower-numbered ports is crucial. It may also be worthwhile to check for any conflicting processes that might already be using port 8081. Examining the HAProxy logs can provide additional insight as to why the second bind is failing. Careful scrutiny of system-level permissions and port usage often resolves such issues.