Skip to content

Commit 8233599

Browse files
committed
[+] Caddy
1 parent 0b32669 commit 8233599

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/setup_caddy.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
3+
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
4+
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
5+
sudo apt update
6+
sudo apt install caddy
7+
8+
systemctl enable caddy --now
9+
ufw allow 80 443
10+
11+
# Ask user to input domain name
12+
echo "Enter your domain name (e.g. example.com):"
13+
read DOMAIN_NAME
14+
15+
# Create Caddyfile
16+
echo "Creating Caddyfile..."
17+
cat <<EOF > /etc/caddy/Caddyfile
18+
${DOMAIN_NAME} {
19+
reverse_proxy localhost:20100
20+
}
21+
EOF

0 commit comments

Comments
 (0)