summaryrefslogtreecommitdiff
path: root/frontends/etc
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-12-03 01:29:35 +0200
committerPaul Buetow <paul@buetow.org>2025-12-03 01:29:35 +0200
commit916f99f92c7e2ec3a34e45dcf3c98d3c023bc2e2 (patch)
tree0a7cd467652fabd67b9788973902761a6de202f0 /frontends/etc
parent589db6bab74a7ba582f873fef3ffee72aa59ccbe (diff)
initial f3s fallback
Diffstat (limited to 'frontends/etc')
-rw-r--r--frontends/etc/httpd.conf.tpl12
-rw-r--r--frontends/etc/relayd.conf.tpl6
2 files changed, 16 insertions, 2 deletions
diff --git a/frontends/etc/httpd.conf.tpl b/frontends/etc/httpd.conf.tpl
index d7095a6..e4d7b84 100644
--- a/frontends/etc/httpd.conf.tpl
+++ b/frontends/etc/httpd.conf.tpl
@@ -161,6 +161,18 @@ server "<%= $prefix %>ecat.buetow.org" {
}
<% } -%>
+# Fallback for f3s hosts
+<% for my $host (@$f3s_hosts) { for my $prefix (@prefixes) { -%>
+server "<%= $prefix.$host %>" {
+ listen on * port 8080
+ log style forwarded
+ location * {
+ root "/htdocs/f3s_fallback"
+ directory auto index
+ }
+}
+<% } } -%>
+
# Defaults
server "default" {
listen on * port 80
diff --git a/frontends/etc/relayd.conf.tpl b/frontends/etc/relayd.conf.tpl
index 68b9e80..93af3e4 100644
--- a/frontends/etc/relayd.conf.tpl
+++ b/frontends/etc/relayd.conf.tpl
@@ -40,10 +40,12 @@ http protocol "https" {
pass header "Sec-WebSocket-Protocol"
<% for my $host (@$f3s_hosts) { for my $prefix (@prefixes) { -%>
+ # Fallback to localhost
+ match request header "Host" value "<%= $prefix.$host -%>" forward to <localhost>
<% if ($host eq 'registry.f3s.buetow.org') { -%>
- match request quick header "Host" value "<%= $prefix.$host -%>" forward to <f3s_registry>
+ match request header "Host" value "<%= $prefix.$host -%>" forward to <f3s_registry>
<% } else { -%>
- match request quick header "Host" value "<%= $prefix.$host -%>" forward to <f3s>
+ match request header "Host" value "<%= $prefix.$host -%>" forward to <f3s>
<% } } } -%>
}