OPNsense Forum

International Forums => German - Deutsch => Topic started by: mtdnet on November 28, 2021, 09:35:27 PM

Title: HA Proxy custom Error Page
Post by: mtdnet on November 28, 2021, 09:35:27 PM
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.
Title: Re: HA Proxy custom Error Page
Post by: mace on November 29, 2021, 04:20:14 PM
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



Title: Re: HA Proxy custom Error Page
Post by: mtdnet on December 04, 2021, 09:20:29 PM
Vielen Dank, hat funktioniert!
Kannst du mir noch verraten, wo man solche Infos herbekommt?
Hast ein paar gute Anlaufstellen für mich?

Danke
Title: Re: HA Proxy custom Error Page
Post by: mace on December 06, 2021, 12:35:26 PM
official HAProxy Documentation
http://cbonte.github.io/haproxy-dconv/2.2/configuration.html (http://cbonte.github.io/haproxy-dconv/2.2/configuration.html)
HAProxy Enterprise Documentation
https://www.haproxy.com/documentation/hapee/ (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.