Statische Website oder SPA hinter Caddy auf dem VPS – mit automatischen Let's Encrypt-Zertifikaten. Echte Befehle, 7 Minuten.
Caddy holt und verlängert Let's-Encrypt-Zertifikate automatisch - ohne certbot-Timer, ohne Konfigurationsakrobatik. Voraussetzung: ein Domain mit A-Record, der auf Ihre VPS-IP zeigt.
ssh root@YOUR_SERVER_IP apt update && apt install -y caddy # for the latest version consider the official caddy.com repo
mkdir -p /var/www/mysite # from your computer: scp -r ./dist/* root@YOUR_SERVER_IP:/var/www/mysite/
cat > /etc/caddy/Caddyfile <<'EOF'
mysite.com {
root * /var/www/mysite
encode gzip
file_server
}
EOF
systemctl reload caddyÖffnen Sie `https://mysite.com` - das Schloss ist bereits da. Caddy hat das Zertifikat ausgestellt und verlängert es selbst. SPA-Routing? Fügen Sie `try_files {path} /index.html` im Site-Block hinzu.
Noch kein Server? Ein Core VPS 4 (€12/Monat) trägt problemlos mehrere Websites.