[Nginx] Custom 502

This commit is contained in:
andryyy 2019-09-24 06:53:13 +02:00
parent 5ae05b5ec0
commit 9b7668d912
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
2 changed files with 22 additions and 0 deletions

View File

@ -210,4 +210,9 @@ server {
} }
include /etc/nginx/conf.d/site.*.custom; include /etc/nginx/conf.d/site.*.custom;
error_page 502 @awaitingupstream;
location @awaitingupstream {
rewrite ^(.*)$ /_status.502.html break;
}
} }

17
data/web/_status.502.html Normal file
View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<title>Missing upstream</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
</head>
<body style='color:grey;text-align:center;font-family: Verdana, "Lucida Sans Unicode", sans-serif'>
<p>Oops, <b>502</b> - we are probably preparing mailcow.</p>
<h1 style="color:#999;font-size:48px">502</h1>
<p>Please do not stop the stack, while we are preparing the database or do other preparations.</p>
<p style="font-size:small"><b>What is happening?</b> - Nginx cannot connect to an upstream server.<br>
This is fine, if mailcow was just
installed or updated and can take a few minutes.<br>
Please check the logs or contact support, if the error persists.</p>
</body>
</html>