From 8eb210482b8523e14f9340f56b08ff6508aa389d Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 3 Oct 2022 04:09:02 +0200 Subject: [PATCH] Add Caddyfile --- Caddyfile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Caddyfile diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..3b913ea --- /dev/null +++ b/Caddyfile @@ -0,0 +1,39 @@ +# Caddy's configuration file +# see: https://caddyserver.com/docs/caddyfile +{ + email admins@pub.solar +} + +pub.solar { + # Uncomment for debugging + #log { + # output stderr + #} + + # PubSolarOS images + handle /os/download/* { + root * /srv + file_server /os/download/* 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} +}