From 453d88c58bf7c65d6575d8f34399488e2c084831 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 30 Dec 2025 10:37:59 +0200 Subject: Document f3s automatic failover configuration in part 7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add comprehensive section explaining how OpenBSD relayd and httpd provide automatic failover when the f3s Kubernetes cluster is down. New content covers: - Relay-level vs protocol-level routing and why protocol rules don't support failover - Health check mechanism and automatic table failover - Correct relayd configuration with f3s first, localhost as backup - httpd configuration with request rewrite for all paths - Explanation of why request rewrite is needed to handle deep links - Benefits of the automatic failover approach This ensures visitors see a helpful status page instead of connection errors when the home lab cluster is offline. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../2025-10-02-f3s-kubernetes-with-freebsd-part-7.gmi.tpl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gemfeed/2025-10-02-f3s-kubernetes-with-freebsd-part-7.gmi.tpl b/gemfeed/2025-10-02-f3s-kubernetes-with-freebsd-part-7.gmi.tpl index c5d76bc5..9a92f204 100644 --- a/gemfeed/2025-10-02-f3s-kubernetes-with-freebsd-part-7.gmi.tpl +++ b/gemfeed/2025-10-02-f3s-kubernetes-with-freebsd-part-7.gmi.tpl @@ -687,17 +687,20 @@ This way, f3s traffic uses the relay's default behavior: try the first table, fa ### OpenBSD httpd fallback configuration -The localhost httpd service on port 8080 serves the fallback content from `/var/www/htdocs/f3s_fallback/`. This directory contains a simple HTML page explaining the situation: +The localhost httpd service on port 8080 serves the fallback content from `/var/www/htdocs/f3s_fallback/`. This directory contains a simple HTML page explaining the situation. + +The key configuration detail is using `request rewrite` to ensure the fallback page is served for ALL paths, not just the root. Without this, accessing paths like `/login?redirect=/files/` would return 404 instead of the fallback page: ``` # OpenBSD httpd.conf -# Fallback for f3s hosts +# Fallback for f3s hosts - serve fallback page for ALL paths server "f3s.foo.zone" { 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 } } @@ -705,14 +708,16 @@ server "anki.f3s.foo.zone" { listen on * port 8080 log style forwarded location * { + request rewrite "/index.html" root "/htdocs/f3s_fallback" - directory auto index } } # ... similar blocks for all f3s hostnames ... ``` +The `request rewrite "/index.html"` directive ensures that whether someone accesses `/`, `/login`, `/api/status`, or any other path, they all receive the same fallback page. This prevents confusing 404 errors when users have bookmarked specific URLs or follow deep links while the cluster is down. + The fallback page itself is straightforward: ```html -- cgit v1.2.3