diff options
| author | Paul Buetow <paul@buetow.org> | 2025-12-30 10:37:18 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-12-30 10:37:18 +0200 |
| commit | 14d6f81d9e10c3271fc6bc690dca71de929ba0c7 (patch) | |
| tree | 9028ce327c382a3bc8616d2fb84e47ce36166cb8 /frontends | |
| parent | a2df9bfbb146731166ef967c23344379e1e23c26 (diff) | |
Add automatic fallback for f3s hosts when cluster is down
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 <noreply@anthropic.com>
Diffstat (limited to 'frontends')
| -rw-r--r-- | frontends/etc/httpd.conf.tpl | 5 |
1 files 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 } } <% } } -%> |
