
Here are some notes about how I got my test Discourse instance running with Caddy Server.
Cool stuff about Caddy:
-
They use Discourse

-
Free SSL with Let’s Encrypt
-
HTTP2 and QUIC out of the box
-
Easier to configure than nginx
Cons:
- Not as battle tested as apache, nginx and cia.
How To
Preparing Discourse
First, you need to apply this changes to your app.yml:
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.ratelimited.template.yml"
- "templates/web.socketed.template.yml" # <<<----- THIS IS NEW
## Leave these two commented out
# - "templates/web.ssl.template.yml"
# - "templates/web.letsencrypt.ssl.template.yml"
## Leave these two commented out
expose:
# - "8080:80" # http
# - "443:443" # https
env:
## This should be commented out
#LETSENCRYPT_ACCOUNT_EMAIL: mymail@gmail.com
## This is required to avoid mixed content warnings when behind a reverse proxy
DISCOURSE_FORCE_HTTPS: true
Preparing Caddy
In the spirit of Discourse, let’s put Caddy in a Docker image too ![]()
First prepare with:
mkdir -p /var/caddy/data /var/caddy/config
nano /var/caddy/Caddyfile
Add the following to the Caddyfile (using Caddy v2 syntax):
{
email MYEMAILHERE@gmail.com
}
forum.example.com { # your domain here
reverse_proxy unix//sock/nginx.http.sock
}
Save and exit.
Let’s test
Now you need to rebuild Discourse:
cd /var/discourse
./launcher rebuild app
And then run Caddy:
docker run -d \
-v /var/caddy/Caddyfile:/etc/caddy/Caddyfile \
-v /var/caddy/data:/data \
-v /var/caddy/config:/config \
-v /var/discourse/shared/standalone:/sock \
-p 80:80 -p 443:443 \
-p 443:443/udp \
--restart=always \
--name caddy \
caddy:latest
After all, your forum should be avaliable at your domain, using SSL + HTTP2 + QUIC. You can’t more hipster than that.
Last edited by @JammyDodger 2024-05-25T11:20:30Z
Check document
Perform check on document:


