Setting up Caddy¶
This guide does not cover NAT evasion
If you need to circumvent NAT, this guide will not help you. Please refer to the circumventing NAT section for more information.
In this guide, I'm going to be using Caddy as my reverse proxy. Caddy is incredibly simple to set up, and features automatic HTTPS, which means you don't need to worry about managing TLS certificates yourself. Caddy is also very performant while being significantly easier to set up than nginx or apache.
First, you will need to install Caddy. Log in to the server where you want to run Caddy, and install Caddy (again, assuming you're using Debian or Ubuntu):
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update && sudo apt install caddy
Once Caddy is installed, go ahead and remove the default config file: sudo rm /etc/caddy/Caddyfile
. You won't be needing it.
Now, using your favourite editor, re-make that file, and add the following:
your-domain.example {
header /.well-known/matrix/* Access-Control-Allow-Origin *
header /.well-known/matrix/* Content-Type application/json
}
That's all for now! Save the file, and then run sudo systemctl restart caddy
.
Now you can move on to setting up Continuwuity.