mirror of
https://github.com/wahyd4/home-docker.git
synced 2026-08-09 04:15:52 +10:00
- Extract Caddyfile from demo-service.yaml into demo-service-caddy.yaml - ArgoCD auto-applies both files; Caddyfile changes are tracked in git - Fixes issue where Caddyfile updates in the source dir weren't reaching the pod
61 lines
1.7 KiB
YAML
61 lines
1.7 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: demo-caddy-config
|
|
namespace: home-apps
|
|
data:
|
|
Caddyfile: |
|
|
# Caddy for Demo Service — internal server, TLS handled by Nginx Ingress
|
|
|
|
:80 {
|
|
log {
|
|
output stdout
|
|
format json
|
|
}
|
|
|
|
# ── Custom error pages (canvas animation, served directly by Caddy) ──
|
|
handle_errors {
|
|
@html_errors expression `{err.status_code} in [401, 403, 404]`
|
|
handle @html_errors {
|
|
root * /app/static
|
|
rewrite * /error-page.html
|
|
file_server
|
|
}
|
|
}
|
|
|
|
# Management API → Python service
|
|
handle /api/* {
|
|
reverse_proxy localhost:3000 {
|
|
header_up Host {host}
|
|
header_up X-Forwarded-For {remote_host}
|
|
header_up X-Forwarded-Proto https
|
|
}
|
|
}
|
|
|
|
# Admin Web UI → Python service
|
|
handle /admin {
|
|
reverse_proxy localhost:3000
|
|
}
|
|
handle /admin/* {
|
|
reverse_proxy localhost:3000
|
|
}
|
|
|
|
# ── Site content: API handles visibility + auth ──
|
|
# Public sites served without auth; drafts require login
|
|
handle {
|
|
rewrite * /site-content{uri}
|
|
reverse_proxy localhost:3000 {
|
|
header_up Host {host}
|
|
header_up X-Forwarded-For {remote_host}
|
|
header_up X-Forwarded-Proto https
|
|
header_up Cookie {http.request.header.Cookie}
|
|
}
|
|
}
|
|
|
|
header {
|
|
X-Content-Type-Options nosniff
|
|
X-Frame-Options SAMEORIGIN
|
|
-Server
|
|
}
|
|
}
|