HA Proxy custom Error Page

Started by mtdnet, November 28, 2021, 09:35:27 PM

Previous topic - Next topic
Hallo,
eine Frage zum HAProxy...
Wenn das Backend einen 404 meldet, soll HAProxy diese anfangen und eine custom page ausliefern.
Ist sowas möglich?


Danke für eure Hilfe.

November 29, 2021, 04:20:14 PM #1 Last Edit: November 29, 2021, 04:34:12 PM by mace
So sollte es gehen

HAProxy -> Public Services -> advanced mode -> Option pass-through
oder
HAProxy -> Backend Pool -> advanced mode -> Option pass-through


http-response return  status 404 content-type "text/html; charset=utf-8" 
lf-file /tmp/haproxy/errorfiles/404.html if { status 404 }

auf der OPNsense im Verzeichnis /tmp/haproxy/errorfiles/ die 404.html ablegen




Vielen Dank, hat funktioniert!
Kannst du mir noch verraten, wo man solche Infos herbekommt?
Hast ein paar gute Anlaufstellen für mich?

Danke

official HAProxy Documentation
http://cbonte.github.io/haproxy-dconv/2.2/configuration.html
HAProxy Enterprise Documentation
https://www.haproxy.com/documentation/hapee/

Dokumentation der Enterprise ist etwas ausführlicher bzw. besser Dargestellt
allerdings zu beachten da sind Features dabei die der Enterprise vorbehalten sind.

Muss man sich halt Gedanken machen wo das in der GUI einzutragen ist.

*Geht zwar auch über die haproxy.conf eine HAProxy Konfiguration vorbei an der OPNsense GUI
macht aber nicht wirklich Sinn, dann ist besser HAProxy auf einem externem System laufen zu haben.