Make Caddy route self-healing

This commit is contained in:
Codex 2026-09-05 10:39:49 +00:00
parent f596bcf491
commit 5386a2e153
3 changed files with 24 additions and 1 deletions

2
deploy/Caddyfile.runtime Normal file
View file

@ -0,0 +1,2 @@
import /etc/caddy/Caddyfile
import /home/snw/bot_save_bablo/deploy/dolznik-bot.caddy

21
deploy/dolznik-bot.caddy Normal file
View file

@ -0,0 +1,21 @@
dolznik-bot.duckdns.org {
encode zstd gzip
header {
X-Content-Type-Options nosniff
Referrer-Policy no-referrer
Permissions-Policy "camera=(), microphone=(), geolocation=()"
}
handle_path /app* {
reverse_proxy 127.0.0.1:8765
}
handle /api/* {
reverse_proxy 127.0.0.1:8765
}
handle {
redir * /app/ 308
}
}

View file

@ -4,7 +4,7 @@ set -u
attempt=0 attempt=0
while [ "$attempt" -lt 12 ]; do while [ "$attempt" -lt 12 ]; do
if /usr/bin/caddy reload \ if /usr/bin/caddy reload \
--config /home/snw/bot_save_bablo/data/Caddyfile.runtime \ --config /home/snw/bot_save_bablo/deploy/Caddyfile.runtime \
--adapter caddyfile; then --adapter caddyfile; then
exit 0 exit 0
fi fi