Add error.html for caddy
이 커밋은 다음에 포함됨:
@@ -2,6 +2,22 @@
|
||||
email [EMAIL]
|
||||
}
|
||||
|
||||
# Snippet riutilizzabile: mostra errorr.html quando il backend non risponde
|
||||
# (502/503/504). Va importato dentro il blocco di ogni sito che fa reverse_proxy.
|
||||
(gateway_error) {
|
||||
handle_errors {
|
||||
@gateway_error expression `{http.error.status_code} in [502, 503, 504]`
|
||||
handle @gateway_error {
|
||||
root * /etc/caddy/html
|
||||
rewrite * /error.html
|
||||
file_server
|
||||
}
|
||||
handle {
|
||||
respond "{http.error.status_code} {http.error.status_text}" {http.error.status_code}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Ogni servizio ha il proprio file in /srv/containers/caddy/sites/*.caddy
|
||||
# (sorgente in git: containers/<servizio>/<servizio>.caddy)
|
||||
import /etc/caddy/sites/*.caddy
|
||||
|
||||
@@ -15,9 +15,10 @@ Image=docker.io/library/caddy:latest
|
||||
#AutoUpdate=registry
|
||||
Network=internal.network
|
||||
|
||||
# mkdir -p /srv/containers/caddy/{sites,data,config}
|
||||
# mkdir -p /srv/containers/caddy/{sites,data,html,config}
|
||||
Volume=/srv/containers/caddy/Caddyfile:/etc/caddy/Caddyfile:ro
|
||||
Volume=/srv/containers/caddy/sites:/etc/caddy/sites:ro
|
||||
Volume=/srv/containers/caddy/html:/etc/caddy/html:ro
|
||||
|
||||
# Persistenti: qui Caddy tiene i certificati Let's Encrypt e lo stato ACME,
|
||||
# NON vanno cancellati o si perdono i certificati (rate limit LE in caso di richieste ripetute)
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;" />
|
||||
<meta name="viewport" content="width=600,initial-scale = 2.3,user-scalable=no">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans:600" rel="stylesheet">
|
||||
|
||||
<title>Update in progress...</title>
|
||||
|
||||
<style type="text/css">
|
||||
*{
|
||||
transition: all 0.6s;
|
||||
}
|
||||
|
||||
html {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background:#000;
|
||||
}
|
||||
|
||||
body{
|
||||
font-family: 'Open Sans';
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#main{
|
||||
display: table;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.logo{
|
||||
margin-bottom:4em;
|
||||
}
|
||||
|
||||
.text{
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.text h1{
|
||||
font-size: 3em;
|
||||
display: inline-block;
|
||||
padding-right: 12px;
|
||||
animation: type .5s alternate infinite;
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
p {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@keyframes type{
|
||||
from{box-shadow: inset -3px 0px 0px #888;}
|
||||
to{box-shadow: inset -3px 0px 0px transparent;}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="main">
|
||||
<div class="text">
|
||||
<div class="logo">
|
||||
<img height="80" src=""/>
|
||||
</div>
|
||||
|
||||
<h1>
|
||||
Update in progress...
|
||||
<!-- Aggiornamento in corso... -->
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
We are updating the software to the new version. Please try again in a few minutes.<br>If this screen has been present for some time, please contact us.
|
||||
<!-- Stiamo aggiornando il software alla nuova versione. Riprova tra qualche minuto.<br>Se questa schermata è presente da diverso tempo, contattaci. -->
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,4 +1,6 @@
|
||||
code.[DOMAIN] {
|
||||
import gateway_error
|
||||
|
||||
request_body {
|
||||
max_size 1GB
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
[domain] {
|
||||
import gateway_error
|
||||
|
||||
# Security Headers
|
||||
header {
|
||||
Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
mattermost.example.com {
|
||||
import gateway_error
|
||||
|
||||
request_body {
|
||||
max_size 50MB
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
music.[DOMAIN] {
|
||||
import gateway_error
|
||||
|
||||
request_body {
|
||||
max_size 50MB
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
office.[DOMAIN] {
|
||||
import gateway_error
|
||||
|
||||
@browser path /browser*
|
||||
reverse_proxy @browser collaboraoffice:9980
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
cloud.[DOMAIN] {
|
||||
import gateway_error
|
||||
|
||||
# Warning HSTS Nextcloud
|
||||
header Strict-Transport-Security "max-age=15552000; includeSubDomains"
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
odoo.[DOMAIN] {
|
||||
import gateway_error
|
||||
|
||||
# Upload di allegati/import di grandi dimensioni
|
||||
request_body {
|
||||
max_size 200MB
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
qwentts.example.com {
|
||||
import gateway_error
|
||||
|
||||
request_body {
|
||||
max_size 100MB
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
vibevoice.example.com {
|
||||
import gateway_error
|
||||
|
||||
request_body {
|
||||
max_size 100MB
|
||||
}
|
||||
|
||||
새 이슈에서 참조
사용자 차단