From 9b7668d91297ae88b41b1ff2ad4e1b57e469e066 Mon Sep 17 00:00:00 2001 From: andryyy Date: Tue, 24 Sep 2019 06:53:13 +0200 Subject: [PATCH] [Nginx] Custom 502 --- data/conf/nginx/site.conf | 5 +++++ data/web/_status.502.html | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 data/web/_status.502.html diff --git a/data/conf/nginx/site.conf b/data/conf/nginx/site.conf index ccb94fa0..0f2b8acf 100644 --- a/data/conf/nginx/site.conf +++ b/data/conf/nginx/site.conf @@ -210,4 +210,9 @@ server { } include /etc/nginx/conf.d/site.*.custom; + + error_page 502 @awaitingupstream; + location @awaitingupstream { + rewrite ^(.*)$ /_status.502.html break; + } } diff --git a/data/web/_status.502.html b/data/web/_status.502.html new file mode 100644 index 00000000..3ec5b7da --- /dev/null +++ b/data/web/_status.502.html @@ -0,0 +1,17 @@ + + + + Missing upstream + + + + +

Oops, 502 - we are probably preparing mailcow.

+

502

+

Please do not stop the stack, while we are preparing the database or do other preparations.

+

What is happening? - Nginx cannot connect to an upstream server.
+ This is fine, if mailcow was just + installed or updated and can take a few minutes.
+ Please check the logs or contact support, if the error persists.

+ +