HAProxy community

HAProxy Start request repeated too quickly

I am having trouble getting HAProxy to start. I am running on a raspberry pi 3b+ with the lastest version of raspbian buster. i tried to manually stop and start the service with no luck.

what does journalctl -xeu haproxy say ?

Here is the Log

that isn’t helpful. Perhaps if you scroll up to when you started haproxy. Otherwise you can try a config check with haproxy -c -f /path/to/config/file.cfg
please copy the text and don’t attach images.

Still the same result and it does say the config file is valid. the log just says the same thing. any ideas on where else i could look? i have been working on this issue for a few days.

thank you for all the help

Try directly. Stop everything systemd related and run from command line.

$ sudo su -
$ systemctl stop haproxy
$ haproxy  -db -f /path/to/config/file.cfg

I get the following error, when following your instructions.

[ALERT] 293/154307 (558) : Starting frontend Local_Server: cannot bind socket []

Thank you for the help

Either you are not root (required for binding to privileged ports < 1024) or there is already something bound to port 80.

I tried changing it to port 8080 and I have the same issue. maybe i have something wrong here?

frontend Local_Server
bind *80
mode http
use_backend camera1 if { path -i -m end /camera1 }
use_backend camera2 if { path -i -m end /camera2 }
default_backend My_Cameras

backend camera1
mode http
option forwardfor
server camera1.local *80

backend camera2
mode http
option forwardfor
server camera2.local *80

backend My_Cameras
mode http
balance roundrobin
option forwardfor
http-request set-header X-Forwarded-Port %[dst_port]
http-request add-header X-Forwarded-Port https if { ssl_fc }
option httpchk HEAD / HTTP/1.1rnHost:localhost
server camera1.local *80
server camera2.local *80

I would also verify that is assigned to one of your interfaces, if your bind line is ‘bind …’

I’m not sure what this is supposed to do, or whether there is just a visualization issue here in the forum (please use code tag </> to format the configuration):

This should be either :80 or *:80.

That doesn’t make sense. Maybe you mean:

server camera1 camera1.local:80
server camera2 camera2.local:80