selfhost/proxy/caddy/Caddyfile

98 lines
1.6 KiB
Text
Raw Normal View History

2024-12-06 16:02:20 +01:00
{
2024-12-10 13:45:54 +01:00
email {env.EMAIL}
log default {
output stdout
format console
}
2024-12-06 16:02:20 +01:00
}
*.{$DOMAIN} {
2024-12-10 13:45:54 +01:00
tls {
dns netcup {
customer_number {env.NETCUP_CUSTOMER_NUMBER}
api_key {env.NETCUP_API_KEY}
api_password {env.NETCUP_API_PASSWORD}
}
propagation_timeout 900s
propagation_delay 600s
resolvers 46.38.225.230 46.38.252.230
}
header Strict-Transport-Security "max-age=63072000"
@git host git.{$DOMAIN}
handle @git {
reverse_proxy forgejo:3000
}
@news host news.{$DOMAIN}
handle @news {
reverse_proxy miniflux:8080
}
@nc-push expression `(host('cloud.{$DOMAIN}') && path('/push/*'))`
handle @nc-push {
reverse_proxy push:7867
}
@nextcloud host cloud.{$DOMAIN}
handle @nextcloud {
reverse_proxy webserver-nextcloud:80
}
@office host office.{$DOMAIN}
handle @office {
reverse_proxy collabora:9980
}
@drawio host drawio.{$DOMAIN}
handle @drawio {
reverse_proxy drawio:8080
}
@whoami host whoami.{$DOMAIN}
handle @whoami {
reverse_proxy whoami:80
}
@push host push.{$DOMAIN}
handle @push {
reverse_proxy ntfy:80
}
@wallabag host wallabag.{$DOMAIN}
handle @wallabag {
reverse_proxy wallabag:80
}
@www host www.{$DOMAIN}
handle @www {
2024-12-10 13:48:23 +01:00
file_server {
root /usr/share/caddy
hide .git Readme.md
}
2024-12-10 13:45:54 +01:00
}
@mail host mail.{$DOMAIN}
handle @mail {
reverse_proxy nginx-mailcow:8090
}
2024-12-11 09:09:31 +01:00
# Fallback unhandled (sub)domains
2024-12-10 13:45:54 +01:00
handle {
2024-12-11 09:09:31 +01:00
error 404
2024-12-10 16:29:08 +01:00
}
handle_errors {
2024-12-11 09:09:31 +01:00
root * /usr/share/caddy
rewrite * /error.html
templates
file_server {
status {err.status_code}
}
2024-12-10 13:45:54 +01:00
}
2024-12-06 16:02:20 +01:00
}
{$DOMAIN} {
2024-12-10 13:45:54 +01:00
redir https://www.{$DOMAIN}{uri}
2024-12-06 16:02:20 +01:00
}