diff --git a/Caddy-Webserver-Config.md b/Caddy-Webserver-Config.md index ef60855..606c46b 100644 --- a/Caddy-Webserver-Config.md +++ b/Caddy-Webserver-Config.md @@ -1,3 +1,50 @@ +## Caddy 2 + +Install Caddy 2 stable release: https://caddyserver.com/docs/install#debian-ubuntu-raspbian + +Like this: +``` +sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https + +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 -y install caddy +``` +Edit Caddyfile: + +``` +sudo nano /etc/caddy/Caddyfile +``` + +Example: + +``` +# Redirecting http to https + +(redirect) { + @http { + protocol http + } + redir @http https://{host}{uri} +} + +boards.example.com { + tls { + load /var/snap/wekan/common/certs + alpn http/1.1 + } + + reverse_proxy 127.0.0.1:3025 +} +``` + + +*** + [Caddy OAuth2 with Let's Encrypt SSL example](OAuth2) ***