Skip to content

Replace Nginx with Caddy as reverse proxy - #42

Merged
thom-techlete merged 2 commits into
mainfrom
copilot/replace-nginx-with-caddy
Mar 4, 2026
Merged

thom-techlete merged 2 commits into
mainfrom
copilot/replace-nginx-with-caddy

Conversation

Copilot AI commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor

Replaces the entire Nginx setup with Caddy v2 across all environments. Caddy eliminates the need for manual SSL certificate management — it obtains and renews Let's Encrypt certs automatically.

Config files

Three Caddyfiles replace the two nginx configs:

File Purpose
docker/caddy/Caddyfile Dev — HTTP only, port 80
docker/caddy/Caddyfile.prod Production — auto HTTPS via ACME
docker/caddy/Caddyfile.prod.http Production behind TLS-terminating load balancer
# Production: automatic HTTPS, security headers, static file caching
rap8.nl, www.rap8.nl {
    encode gzip
    header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
    handle /static/* { root * /app; file_server; header Cache-Control "public, max-age=2592000, immutable" }
    handle { reverse_proxy web:8000 { header_up Host {host}; header_up X-Real-IP {remote_host} } }
}

Docker Compose

  • All three compose files (dev, prod, prod.http) updated: nginx:stable → caddy:2
  • docker-compose.prod.yml gains caddy_data and caddy_config named volumes for persistent cert storage, and exposes 443/udp for HTTP/3
  • SSL cert volume mounts (/etc/letsencrypt/...) removed — no longer needed

Removed

  • docker/nginx/nginx.conf and docker/nginx/nginx.prod.conf deleted
  • setup_ssl function removed from scripts/deploy.sh (certbot setup, cron renewal hook)
  • scripts/generate_secrets.sh no longer creates an SSL directory

Docs & scripts updated

DEPLOYMENT.md, CI_CD_SETUP.md, project_description.md, roadmap.md, README.md, and error-pages/README.md all updated to reflect Caddy.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 127.0.0.11
    • Triggering command: REDACTED, pid is -1 (packet block)
  • 172.19.0.1
    • Triggering command: REDACTED, pid is -1 (packet block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

replace the nginx setup by Caddy. make sure to replace all. test to make sure it works


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: thom-techlete <176420111+thom-techlete@users.noreply.github.com>
Copilot AI changed the title [WIP] Replace Nginx setup with Caddy configuration Replace Nginx with Caddy as reverse proxy Mar 4, 2026
@thom-techlete
thom-techlete marked this pull request as ready for review March 4, 2026 22:36
@thom-techlete
thom-techlete merged commit 8346441 into main Mar 4, 2026
2 checks passed
@thom-techlete
thom-techlete deleted the copilot/replace-nginx-with-caddy branch March 4, 2026 22:40

This branch had an error being deployed

1 failed deployment
production — 9c15ed8c Deployed Mar 4, 2026 by thom-techlete via Deploy to Production #32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants