HAProxy community

Disable frontend when backend is unavailable


By default an http(s) frontend with an unavailable backend replies with 500. You can also configure the frontend to immediately close the connection in this case.
But I did not find a possibility to disable the frontend in the same way as the ‘disable’ command on the stats console (and re-enable it after re-availability).
Is there a way to achieve this behavior, or do I have to write a feature request?
Why would someone have this? If you have a client (not a browser) that only supports the most simple health check (tcp-ping), that’s the behavior you need.


No, this is no supported, it also very rarely works because usually you’d bind to privileged ports and downgrade privileges after the initial bind, making it so that haproxy cannot rebind to the socket while running.