Use Caddy to serve localhost HTTPS

This commit is contained in:
jude
2025-11-23 10:32:37 +00:00
parent a4ec39e4a2
commit b273d8035a
2 changed files with 40 additions and 0 deletions

24
Caddyfile Normal file
View File

@@ -0,0 +1,24 @@
# Caddy v2 configuration for local development (HTTPS on localhost)
# Reverse-proxy to the bot service and serve static assets.
# Uses Caddy's internal CA to generate a self-signed certificate for localhost.
# HTTP -> HTTPS redirect for local development
:80 {
redir https://localhost{uri}
}
# Local HTTPS site with self-signed cert
localhost {
encode zstd gzip
# Issue a locally-trusted certificate via Caddy's internal CA
tls internal
# Serve static files under /static from the mounted volume
handle_path /static* {
root * /var/www/reminder-rs/static
file_server
}
# Proxy everything else to the bot service inside the Docker network
reverse_proxy bot:18920
}