caddy/ reproduces nginx's routes, gates, /notes/ privacy denials, uploads (bucket first, then disk), rate limits, real-IP and headers in one shared route table, with certificates obtained over DNS-01 in-process instead of by certbot. Until the cutover it serves nothing public: loopback-only ports 8880/8443, no network aliases, its own address. The image build validates the prod and dev configs, so a broken Caddyfile stops the deploy before any container is replaced (`make check-caddy` is the same build). caddy/edge_test.sh checks the privacy boundary and the gates and prints everything else for diffing nginx against Caddy before switching over. Co-Authored-By: Claude Opus 5.5 <[email protected]>
33 lines
1.3 KiB
Plaintext
33 lines
1.3 KiB
Plaintext
# =============================================================================
|
|
# sites/dev.caddy — LOCAL DEVELOPMENT sites. Imported by the Caddyfile when
|
|
# CADDY_SITE=dev, which only docker-compose.dev.yml sets.
|
|
#
|
|
# HOW IT DIFFERS FROM sites/prod.caddy
|
|
# - `/` is proxied to the Vite dev server at vue:5173 instead of serving the
|
|
# built SPA. Its HMR websocket needs nothing extra.
|
|
# - http AND https both serve the full site, with no redirects, so
|
|
# http://localhost just works. Listing the http:// addresses is what
|
|
# stops Caddy adding its automatic http -> https redirect.
|
|
# - TLS is `tls internal`: a certificate from Caddy's own local CA, kept in
|
|
# ./caddy/data. Browsers warn until that CA is trusted, which is expected.
|
|
# - No security headers: HSTS on localhost would poison the browser for
|
|
# every other localhost project on the machine.
|
|
# - No static-asset caching: Vite serves those, and long cache lifetimes
|
|
# would defeat hot reload.
|
|
# Everything else, every proxied route, gate, denial and rate limit, is the
|
|
# same routes.caddy as production.
|
|
# =============================================================================
|
|
|
|
http://{$DOMAIN}, https://{$DOMAIN}, http://www.{$DOMAIN}, https://www.{$DOMAIN} {
|
|
tls internal
|
|
import common
|
|
|
|
route {
|
|
import ../routes.caddy
|
|
|
|
handle {
|
|
reverse_proxy vue:5173
|
|
}
|
|
}
|
|
}
|