debug: output mismatched backend host

This commit is contained in:
WeebDataHoarder
2025-04-30 03:11:29 +02:00
parent b3cd741bee
commit e46a5c75f8
2 changed files with 4 additions and 2 deletions

View File

@@ -92,6 +92,7 @@ func (b *Bind) Server(backends map[string]http.Handler, acmeCachePath string) (*
swap(http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
backend := utils.SelectHTTPHandler(backends, r.Host)
if backend == nil {
slog.Debug("no backend for host", "host", r.Host)
http.Error(w, http.StatusText(http.StatusBadGateway), http.StatusBadGateway)
} else {
backend.ServeHTTP(w, r)