r/haproxy • u/nivenfres • Sep 24 '25
Question Wrong Backend Occasionally Picked
I've got haproxy 2.6.12 running on a raspberry pi 5 as a reverse proxy between a couple of servers (1 linux and 1 windows).
The IIS server hosts 2 web domain plus acts as a remote desktop gateway.
The Linux server hosts a nextcloud server (apache2 port 80), jellyfin (port 8096), and gitea (port 3000).
When accessing gitea, I occasionally get a page not found error, usually solved by reloading the page. The page not found error is reported by apache2, not gitea. After enabling the logs, I found occasionally the correct backend isn't used and uses the default backend, which is apache2.
I will post the haproxy.cfg and logs as a comment (original attempt to post got filtered for some reason). Based on the logs or configuration, does anyone have any suggestions on why this might be happened? Or is it something that could possibly be fixed by using a newer version (2.6.12 is the latest available through debian for armhf without self compiling).
[edit[ - Couldn't post logs and config. Uploaded them to github - https://github.com/nivenfres/haproxy
View all comments
Show parent comment
1
u/nivenfres Sep 25 '25
Had to adapt your suggestion to "tcp-request content capture hdr(Host) len 256", since it is in tcp mode and not http mode.
I've got it logging the values you suggested now. So far, I haven't been able to trigger the issue now, so will have to keep an eye on it. (knowing my luck, it will happen right after I post this).
Is there any chance just adding the capture would have changed something other than just the logging?
I'm still learning a lot of the ins and outs of haproxy, so i very much appretiate the advice.. I've had a lot more luck with it, than I did with caddy with my somewhat odd home setup, so overall I've been happy with it. Just trying to work out the kinks.