From 3384054508a5f53314d2fb1dc95d911211151cd4 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 4 Jun 2022 20:50:31 +0200 Subject: [PATCH] Init www for pub.solar and pub.solar/os --- www/caddy/Caddyfile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 www/caddy/Caddyfile diff --git a/www/caddy/Caddyfile b/www/caddy/Caddyfile new file mode 100644 index 0000000..342c872 --- /dev/null +++ b/www/caddy/Caddyfile @@ -0,0 +1,38 @@ +# Caddy's configuration file +# see: https://caddyserver.com/docs/caddyfile +{ + email admins@pub.solar +} + +pub.solar { + log { + output stderr + } + + # PubSolarOS images + handle /os/* { + root * /srv + file_server /os/* browse + } + + # serve base domain pub.solar for mastodon.pub.solar + # https://masto.host/mastodon-usernames-different-from-the-domain-used-for-installation/ + handle /.well-known/host-meta { + redir https://mastodon.pub.solar{uri} + } + + # pub.solar website + handle { + root * /srv/pub.solar + try_files {path}.html {path} + file_server + } + + handle_errors { + respond "{http.error.status_code} {http.error.status_text}" + } +} + +www.pub.solar { + redir https://pub.solar{uri} +}