Amaseva ewebhu
Iseva yewebhu yesimanje ene-HTTPS ezenzakalelayo kanye nokucushwa okulula
Ukuthola nokuvuselela ngokuzenzakalelayo izitifiketi ze-SSL/TLS ezivela ku-Let's Encrypt ngaphandle kokumisa
Ifomethi ye-Caddyfile eqondakala kalula ukuyibhala nokuyigcina, noma i-JSON yokulawula ngohlelo
Ukusekelwa kwemvelo kwe-HTTP/2, i-HTTP/3 (QUIC), i-WebSocket, i-gRPC, nezinye izinkomba zamanje
Reverse proxy enamandla nokwabelana ngomthwalo, ukuhlola impilo, izivikelo zokuwohloka kwesistimu, nokuthatha esikhundleni okusebenzayo/okungasebenzi
Khipha izitifiketi ngesidingo zamapulathifomu e-SaaS anezizinda ezenziwe ngokwezifiso ezinkulungwane
Layisha kabusha ukumisa ngobunono ngaphandle kokuphonsa izixhumo noma ukuphazamiseka kwesevisi
# Install Caddy from official repository
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
# Or download binary directly
curl -o caddy 'https://caddyserver.com/api/download?os=linux&arch=amd64'
chmod +x caddy
sudo mv caddy /usr/local/bin/
# Verify installation
caddy versionUkuqala Ngokushesha, Iwebhusayithi Esitatikhi:# Create Caddyfile
cat > Caddyfile <<EOF
example.com {
root * /var/www/html
file_server
}
EOF
# Start Caddy
sudo caddy start
# Or run in foreground
sudo caddy runIsibonelo Se-Reverse Proxy:cat > Caddyfile <<EOF
api.example.com {
reverse_proxy localhost:8080
}
EOF
sudo caddy run
# Simple static site with automatic HTTPS
example.com {
root * /var/www/html
file_server
encode gzip
}
# Reverse proxy to backend
api.example.com {
reverse_proxy localhost:3000
}
# Multiple backends with load balancing
app.example.com {
reverse_proxy localhost:8080 localhost:8081 localhost:8082 {
lb_policy round_robin
health_uri /health
}
}
# SPA with fallback
spa.example.com {
root * /var/www/spa
try_files {path} /index.html
file_server
}Izici Ezithuthukile:encode gzip zstd ukuze uthole ukucindezela okungconofile_server {precompressed gzip br} wamafayela asecindezelwe kusengaphambiliheader ukusetha amakhanda okugcina i-cache
Qala imizuzu ngenqubo yethu elula yokufaka i-VPS
Deploy ku mayelana 2 imizuzu • Full root ukufinyelela • Usizo nge tiketi ne-imeyili