Haproxy custom 503 error pages not working when set on backend, only when set on the primary front end.
-
If anyone has worked out how to use custom 503 error pages per host/backend using the pfSense implementation of Haproxy, could you please share how you did it?
I have a Front end which handles the certs/SNI, then I have a shared front end below that handles ACL and Actions (which backend to use) this shared front end refers to the cert/sni as the primary front end.
I have some hosts/backends that are only accessible to networks/IPs that are defined in the AdminNet pfsense firewall Networks alias.
ACL:
Action:
If a users IP/network is not on the AdminNet alias, then haproxy generates a 503 page.
Haproxy has provision for custom Files which can be used to display custom 503 pages.
If I set a custom 503 page on the cert/sni front end it works, but there is no way to have custom 503 pages per host/backend if you do this way.So I noticed custom error pages can even be set on the shared front end or the backends, neither of those spots work for me. If I remove the custom 503 page from the primary front end, and try to set it on the individual backends, then the custom 503 pages never load, instead it just gives you the generic 503 page that haproxy generates.
also here is a copy of my custom 503 page:
HTTP/1.0 503 Service Unavailable Cache-Control: no-cache Connection: close Content-Type: text/html <html><head><title>Page not found</title></head><body> <h2>Page not found. <a href="https://www.example.com">return home</a></h2> </body></html>
If anyone has worked out how to use custom 503 error pages per host/backend using the pfSense implementation of Haproxy, could you please share how you did it?
There are fields for custom error pages on regular front ends, shared front ends, as well as backends, so I am assuming there should be a way to get them to work.
for instance here is where you would find the field on the backend settings: