From 14d6f81d9e10c3271fc6bc690dca71de929ba0c7 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 30 Dec 2025 10:37:18 +0200 Subject: Add automatic fallback for f3s hosts when cluster is down MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Configure OpenBSD relayd and httpd to serve a friendly fallback page when the f3s Kubernetes cluster is unreachable. Changes to relayd.conf.tpl: - Reorder relay forward statements: f3s first, localhost as backup - Remove protocol-level forward rules for f3s hosts to enable relay-level failover - Add explicit localhost routing for non-f3s hosts - Health checks on f3s table trigger automatic failover to localhost Changes to httpd.conf.tpl: - Add request rewrite directive to serve fallback page for ALL paths - Prevents 404 errors for deep links like /login?redirect=/files/ - Ensures consistent fallback experience regardless of requested URL When all f3s nodes fail health checks, traffic automatically routes to localhost:8080 serving static fallback content from /var/www/htdocs/f3s_fallback. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- frontends/etc/httpd.conf.tpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontends/etc/httpd.conf.tpl b/frontends/etc/httpd.conf.tpl index e4d7b84..32d80e7 100644 --- a/frontends/etc/httpd.conf.tpl +++ b/frontends/etc/httpd.conf.tpl @@ -161,14 +161,15 @@ server "<%= $prefix %>ecat.buetow.org" { } <% } -%> -# Fallback for f3s hosts +# Fallback for f3s hosts - serve fallback page for ALL paths <% for my $host (@$f3s_hosts) { for my $prefix (@prefixes) { -%> server "<%= $prefix.$host %>" { listen on * port 8080 log style forwarded location * { + # Rewrite all requests to /index.html to show fallback page regardless of path + request rewrite "/index.html" root "/htdocs/f3s_fallback" - directory auto index } } <% } } -%> -- cgit v1.2.3