Add 502 custom error page (#1530)

This commit is contained in:
tituspijean 2022-11-14 23:24:08 +01:00 committed by GitHub
parent c50f3771da
commit 5063e12835
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 0 deletions

View file

@ -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;

View file

@ -0,0 +1,7 @@
error_page 502 /502.html;
location = /502.html {
root /usr/share/yunohost/html/;
}

20
share/html/502.html Normal file
View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>502 Bad Gateway</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>502 Bad Gateway</h1>
<p>If you see this page, your connection with the server is working but the internal service providing this path is not responding.</p>
<p>Administrator, make sure that the service is running, and check its logs if it is not.
The Services page is in your webadmin, under <code>Tools > Services</code>.</p>
<p><em>Thank you for using YunoHost.</em></p>
</body>
</html>

View file

@ -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.*$",