Add unavailable page when PHP-FPM is down: Caddy handle_errors on 502/503

- Create unavailable.html static page with neo-brutalist design and retry button
- Add handle_errors in Caddy for 502/503: serve unavailable.html
- Add dial/read/write timeouts to php_fastcgi (5s/30s/30s)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-03-20 20:14:41 +01:00
parent 00a2ebe79d
commit bbe727b1d4
2 changed files with 39 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ ticket.e-cosplay.fr {
dns cloudflare {{ cloudflare_api_token }}
}
@static path /logo.png /favicon.ico /favicon.png /marker.png /screen.png /manifest.json /site.webmanifest /sw.js /workbox/* /idb/* /build/* /uploads/* /pwa/*
@static path /logo.png /favicon.ico /favicon.png /marker.png /screen.png /manifest.json /site.webmanifest /sw.js /unavailable.html /workbox/* /idb/* /build/* /uploads/* /pwa/*
handle @static {
root * /var/www/e-ticket/public
file_server
@@ -38,11 +38,23 @@ ticket.e-cosplay.fr {
root /app/public
lb_policy round_robin
trusted_proxies private_ranges
dial_timeout 5s
read_timeout 30s
write_timeout 30s
}
file_server
try_files {path} /index.php?{query}
}
handle_errors {
@unavailable expression `{err.status_code} in [502, 503]`
handle @unavailable {
root * /var/www/e-ticket/public
rewrite * /unavailable.html
file_server
}
}
encode gzip
header {