diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-08 19:02:59 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-08 19:02:59 +0300 |
| commit | 7e58ff1737ed72eef05b107ac0390227bec69b39 (patch) | |
| tree | 04887c8d3fb379e91c710cbb638ea9ba7fd96b7b /frontends | |
| parent | 2ce01914f4214dc7a06583ebafd63298274a4f73 (diff) | |
Add offline-page fallback for f3s static relay
Diffstat (limited to 'frontends')
| -rw-r--r-- | frontends/etc/relayd.conf.tpl | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/frontends/etc/relayd.conf.tpl b/frontends/etc/relayd.conf.tpl index 6248dee..70fbeab 100644 --- a/frontends/etc/relayd.conf.tpl +++ b/frontends/etc/relayd.conf.tpl @@ -14,6 +14,12 @@ table <f3s_static> { 192.168.2.204 } +# Local relayd hop for the static landing page, used to get a real localhost fallback +table <f3s_static_proxy> { + 127.0.0.1 + ::1 +} + # Same backends, separate table for registry service on port 30001 table <f3s_registry> { 192.168.2.120 @@ -57,7 +63,6 @@ http protocol "https" { # Enable WebSocket support http websockets - return error match request header set "X-Forwarded-For" value "$REMOTE_ADDR" match request header set "X-Forwarded-Proto" value "https" @@ -83,7 +88,7 @@ http protocol "https" { for my $prefix (@prefixes) { if ($host eq 'f3s.buetow.org') { -%> - match request header "Host" value "<%= $prefix.$host -%>" forward to <f3s_static> + match request header "Host" value "<%= $prefix.$host -%>" forward to <f3s_static_proxy> <% } elsif ($host eq 'registry.f3s.buetow.org') { -%> match request header "Host" value "<%= $prefix.$host -%>" forward to <f3s_registry> @@ -109,8 +114,8 @@ relay "https4" { session timeout 300 # Primary: f3s cluster (with health checks) - Falls back to localhost when all hosts down forward to <f3s> port 80 check tcp - # Static landing page served from pi0/pi1 instead of k3s - forward to <f3s_static> port 80 check tcp + # Static landing page is routed through a local relay so it can fall back to localhost + forward to <f3s_static_proxy> port 18080 check tcp forward to <localhost> port 8080 check http "/" code 200 # Registry uses separate port and table forward to <f3s_registry> port 30001 check tcp @@ -126,8 +131,8 @@ relay "https6" { session timeout 300 # Primary: f3s cluster (with health checks) - Falls back to localhost when all hosts down forward to <f3s> port 80 check tcp - # Static landing page served from pi0/pi1 instead of k3s - forward to <f3s_static> port 80 check tcp + # Static landing page is routed through a local relay so it can fall back to localhost + forward to <f3s_static_proxy> port 18080 check tcp forward to <localhost> port 8080 check http "/" code 200 # Registry uses separate port and table forward to <f3s_registry> port 30001 check tcp @@ -185,3 +190,15 @@ relay "gemini6" { protocol "gemini" forward to 127.0.0.1 port 11965 } + +relay "f3s_static_proxy4" { + listen on 127.0.0.1 port 18080 + forward to <f3s_static> port 80 check tcp + forward to <localhost> port 8080 check http "/" code 200 +} + +relay "f3s_static_proxy6" { + listen on ::1 port 18080 + forward to <f3s_static> port 80 check tcp + forward to <localhost> port 8080 check http "/" code 200 +} |
