# Caddy in front of app’s Nginx via Docker Compose

**URL:** https://meta.discourse.org/t/caddy-in-front-of-app-s-nginx-via-docker-compose/410123
**Category:** Self-hosting
**Tags:** nginx, install
**Created:** [15 augustus 2026 om 07:03 UTC](https://meta.discourse.org/t/caddy-in-front-of-app-s-nginx-via-docker-compose/410123 "2026-08-15T07:03:16Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![Ethsim2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethsim2/32/522255_2.png) [@Ethsim2](https://meta.discourse.org/u/Ethsim2)
#### Post date: [15 augustus 2026 om 20:50 UTC](https://meta.discourse.org/t/caddy-in-front-of-app-s-nginx-via-docker-compose/410123/3 "2026-08-15T20:50:52Z")

</div>

Thanks, I hadn’t seen that PR. That’s interesting - my setup is slightly different in that I’ve kept Discourse’s nginx web server in place and run Caddy separately in Docker Compose in front of it, mainly to provide `HTTP/3` at the edge.

There is one small Discourse-side change: I added a persistent `app.yml` hook so nginx uses Caddy’s `X-Forwarded-For` value for the real client IP when requests arrive over the Unix socket. I originally needed a Caddy `X-Real-IP` workaround, but after adding the nginx-side fix I was able to remove that and verify that Discourse still records the correct client IP.

I’ve also explicitly disabled `QUIC 0-RTT`/early data in the Caddy configuration while leaving HTTP/3 enabled, to avoid that additional early-data edge case.

My approach also enables Caddy’s HTTP access logging at the site level, which gives me Caddy’s default redaction of sensitive credential headers. I rotate the resulting Docker `json-file` logs at `25 MB × 3`. I noticed the PR currently has its rotating log block in Caddy’s global options, which Caddy’s documentation describes as configuring runtime logging rather than HTTP access logging.

So it isn’t quite a completely untouched [standard install](https://meta.discourse.org/t/142537?silent=true), but it’s also a different approach from replacing nginx with Caddy altogether.

I’ll have a closer look at that PR. For now I’m mainly interested in whether there is enough interest in this approach to make a step-by-step guide worthwhile, rather than starting on one immediately.

---

_[View the full topic](https://meta.discourse.org/t/caddy-in-front-of-app-s-nginx-via-docker-compose/410123)._
