summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2024-03-16 00:14:26 +0200
committerPaul Buetow <paul@buetow.org>2024-03-16 00:14:26 +0200
commitd719cb0762f1a5c83f6e18858d6ad7f7bb6035a7 (patch)
tree04ac2677aa5c0a02067d74ed4c8dfc23d2138c7d
parent13b5ea8e1cb6a7fd513ba7ae6828234fec5d5115 (diff)
redirect www -> without www
-rw-r--r--frontends/Rexfile19
-rw-r--r--frontends/etc/httpd.conf.tpl4
2 files changed, 4 insertions, 19 deletions
diff --git a/frontends/Rexfile b/frontends/Rexfile
index 3853500..36f76d6 100644
--- a/frontends/Rexfile
+++ b/frontends/Rexfile
@@ -518,25 +518,6 @@ task 'gorum', group => 'frontends',
service 'gorum', ensure => 'started';
};
-#desc 'Setup Wireguard server';
-#task 'wireguard_server', group => 'wgserver',
-# sub {
- # Following https://ianix.com/wireguard/openbsd-howto.html
-# pkg 'wireguard-tools', ensure => present;
-
-# concat_fragment 'ipforwarding',
-# target => '/etc/sysctl.conf',
-# content => 'net.inet.ip.forwarding=1';
-#
-# concat_fragment 'ip6forwarding',
-# target => '/etc/sysctl.conf',
-# content => 'net.inet6.ip6.forwarding=1';
-#
-# concat '/etc/sysctl.conf',
-# ensure => 'present',
-# on_change => sub { say "Changed" };
-# };
-
desc 'Setup IRC bouncer';
task 'ircbouncer', group => 'ircbouncer',
sub {
diff --git a/frontends/etc/httpd.conf.tpl b/frontends/etc/httpd.conf.tpl
index 1937b70..afe9581 100644
--- a/frontends/etc/httpd.conf.tpl
+++ b/frontends/etc/httpd.conf.tpl
@@ -43,8 +43,12 @@ server "<%= $prefix.$host %>" {
block return 302 "https://<%= $prefix.$host %>"
}
location * {
+ <% if ($prefix eq 'www.') { -%>
+ block return 302 "https://<%= $host %>$REQUEST_URI"
+ <% } else { -%>
root "/htdocs/gemtexter/<%= $host %>"
directory auto index
+ <% } -%>
}
}
<% } %>