From 840ecf29535880109a7cbd5290a0ff33c51b04f0 Mon Sep 17 00:00:00 2001 From: jbergner Date: Sat, 8 Nov 2025 22:54:16 +0100 Subject: [PATCH] test with blockpage --- main.go | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index ac5be90..e380489 100644 --- a/main.go +++ b/main.go @@ -441,7 +441,8 @@ func handleTraefik(w http.ResponseWriter, r *http.Request) { if len(matches) > 0 { checkBlocked.Inc() - http.Error(w, "blocked", http.StatusForbidden) + errorhtml(w, r) + //http.Error(w, "blocked", http.StatusTooManyRequests) return } w.WriteHeader(http.StatusOK) @@ -650,3 +651,144 @@ func handleGUI(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html; charset=utf-8") _, _ = w.Write([]byte(html)) } + +func errorhtml(w http.ResponseWriter, r *http.Request) { + html := ` + + + + + Webserver ist nicht erreichbar - Fehler 521 + + + +
+
+

Webserver ist nicht erreichbar

+ Fehlercode 521 (Origin Server verweigert Verbindung) +
+

+ Dein Browser funktioniert, der Edge-Proxy ist erreichbar - aber der Origin-Server antwortet nicht oder die Verbindung wird verweigert. +

+ +
+ +
+ +

Du

+

Browser

+

Funktioniert

+
+ + +
+ +

Edge-Proxy

+

Zwischenschicht

+

Funktioniert

+
+ + +
+ +

Host

+

Origin-Server

+

Fehler

+
+
+ +
+ + +
+ +
+ Technische Details +
    +
  • Fehler: 521 - Origin verweigert die Verbindung (z. B. Firewall, blockierter Port, kein Dienst am Ziel).
  • +
  • Zeit: -
  • +
+

Tipps: Prüfe, ob dein Backend erreichbar ist (TCP/443 oder 80), ob der Dienst läuft und ob eine Firewall/Fail2ban/Rate-Limit die Proxy-IP blockiert.

+
+ +
+ Wenn das Problem fortbesteht, kontaktiere den Betreiber der Website. +
+
+ + + +` + + w.Header().Set("Content-Type", "text/html; charset=utf-8") + _, _ = w.Write([]byte(html)) +}