switch from nginx to caddy

This commit is contained in:
2024-12-19 16:10:41 +01:00
parent 856fdecbb5
commit d2dfd1a8e0
9 changed files with 160 additions and 40 deletions

26
caddy/sites/ha.caddy Normal file
View File

@@ -0,0 +1,26 @@
ha.{$SUBDOMAIN}.{$DOMAIN} {
log {
output file /var/log/ha.log
}
route {
@app <<CEL
header({'X-Requested-With': 'io.homeassistant.companion.android'}) ||
header_regexp('User-Agent', '^Home Assistant') ||
header_regexp('User-Agent', 'Android')
CEL
handle @app {
reverse_proxy host:8123
}
handle {
reverse_proxy /outpost.goauthentik.io/* http://host:19000
forward_auth http://host:19000 {
uri /outpost.goauthentik.io/auth/caddy?rd={http.request.uri}
copy_headers {
X-Homeassistant-User
}
}
reverse_proxy host:8123
}
}
}