Make Caddy route self-healing
This commit is contained in:
parent
f596bcf491
commit
5386a2e153
3 changed files with 24 additions and 1 deletions
2
deploy/Caddyfile.runtime
Normal file
2
deploy/Caddyfile.runtime
Normal 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
21
deploy/dolznik-bot.caddy
Normal 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
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ set -u
|
|||
attempt=0
|
||||
while [ "$attempt" -lt 12 ]; do
|
||||
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
|
||||
exit 0
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue