diff --git a/conf/nginx/server.tpl.conf b/conf/nginx/server.tpl.conf index 4ee20a720..d5b1d3bef 100644 --- a/conf/nginx/server.tpl.conf +++ b/conf/nginx/server.tpl.conf @@ -30,6 +30,8 @@ server { include /etc/nginx/conf.d/{{ domain }}.d/*.conf; {% endif %} + include /etc/nginx/conf.d/yunohost_http_errors.conf.inc; + access_log /var/log/nginx/{{ domain }}-access.log; error_log /var/log/nginx/{{ domain }}-error.log; } @@ -67,6 +69,7 @@ server { include /etc/nginx/conf.d/yunohost_sso.conf.inc; include /etc/nginx/conf.d/yunohost_admin.conf.inc; include /etc/nginx/conf.d/yunohost_api.conf.inc; + include /etc/nginx/conf.d/yunohost_http_errors.conf.inc; access_log /var/log/nginx/{{ domain }}-access.log; error_log /var/log/nginx/{{ domain }}-error.log; diff --git a/conf/nginx/yunohost_http_errors.conf.inc b/conf/nginx/yunohost_http_errors.conf.inc new file mode 100644 index 000000000..76f1015f3 --- /dev/null +++ b/conf/nginx/yunohost_http_errors.conf.inc @@ -0,0 +1,7 @@ +error_page 502 /502.html; + +location = /502.html { + + root /usr/share/yunohost/html/; + +} diff --git a/share/html/502.html b/share/html/502.html new file mode 100644 index 000000000..bef0275df --- /dev/null +++ b/share/html/502.html @@ -0,0 +1,20 @@ + + +
+If you see this page, your connection with the server is working but the internal service providing this path is not responding.
+Administrator, make sure that the service is running, and check its logs if it is not.
+The Services page is in your webadmin, under Tools > Services
.
Thank you for using YunoHost.
+ + diff --git a/src/app.py b/src/app.py index 6dcc66c71..f4d125a47 100644 --- a/src/app.py +++ b/src/app.py @@ -1488,6 +1488,7 @@ def app_ssowatconf(): "uris": [domain + "/yunohost/admin" for domain in domains] + [domain + "/yunohost/api" for domain in domains] + [ + "re:^[^/]/502%.html$", "re:^[^/]*/%.well%-known/ynh%-diagnosis/.*$", "re:^[^/]*/%.well%-known/acme%-challenge/.*$", "re:^[^/]*/%.well%-known/autoconfig/mail/config%-v1%.1%.xml.*$",