Merge pull request 'nginx-error-pages' (#45) from nginx-error-pages into main
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good

Reviewed-on: #45
This commit is contained in:
Franzi 2021-08-07 20:10:01 +00:00
commit 36de4f0c58
4 changed files with 160 additions and 0 deletions

View file

@ -72,6 +72,18 @@ server {
% endif
add_header Permissions-Policy interest-cohort=();
error_page 404 /not_found.html;
location = /not_found.html {
root /var/www/;
internal;
}
error_page 500 502 503 504 /error.html;
location = /error.html {
root /var/www/;
internal;
}
% if ssl == 'letsencrypt':
location /.well-known/acme-challenge/ {
alias /var/lib/dehydrated/acme-challenges/;

View file

@ -65,6 +65,8 @@ files = {
'/usr/local/share/icinga/plugins/check_nginx_status': {
'mode': '0755',
},
'/var/www/error.html': {},
'/var/www/not_found.html': {},
}
if node.has_bundle('pacman'):
files['/etc/systemd/system/nginx.service.d/bundlewrap.conf'] = {

View file

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html>
<head>
<title>Server Error</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>❌</text></svg>">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
:root {
--text-color: #111;
--bg-color: #FFFFFF;
--line-color: #FF0000;
--page-width: 70%;
}
@media (prefers-color-scheme: dark) {
:root {
--text-color: #FFFFFF;
--bg-color: #222222;
--line-color: #800000;
}
}
@media screen and (max-width: 800px) {
:root {
--page-width: 95%;
}
}
* {
font-family: "Segoe UI", system-ui, "Roboto", "Helvetica Neue", "Arial";
color: var(--text-color);
margin: 0;
padding: 0;
}
html {
background-color: var(--bg-color);
}
.header{
border-bottom-width: 10px;
border-bottom-style: solid;
border-bottom-color: var(--line-color);
padding-bottom: 1em
}
h1{
vertical-align: middle;
margin: 0 auto;
width: var(--page-width);
}
.emoji{
vertical-align: middle;
font-size: 3em;
margin-right: 0.5em;
}
.text{
margin: 1em auto;
width: var(--page-width);
font-size: 1.5em;
}
</style>
</head>
<body>
<div class="content">
<div class="header" >
<h1><span class="emoji"></span> Server Error</h1>
</div>
<div class="text">
<p>Dieses System ist aktuell nicht verfügbar.</p>
<p>This system is currently unavailable.</p>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html>
<head>
<title>Not Found</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🔦</text></svg>">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style type="text/css">
:root {
--text-color: #111;
--bg-color: #FFFFFF;
--line-color: #FF7800;
--page-width: 70%;
}
@media (prefers-color-scheme: dark) {
:root {
--text-color: #FFFFFF;
--bg-color: #222222;
--line-color: #ac3800;
}
}
@media screen and (max-width: 800px) {
:root {
--page-width: 95%;
}
}
* {
font-family: "Segoe UI", system-ui, "Roboto", "Helvetica Neue", "Arial";
color: var(--text-color);
margin: 0;
padding: 0;
}
html {
background-color: var(--bg-color);
}
.header{
border-bottom-width: 10px;
border-bottom-style: solid;
border-bottom-color: var(--line-color);
padding-bottom: 1em
}
h1{
vertical-align: middle;
margin: 0 auto;
width: var(--page-width);
}
.emoji{
vertical-align: middle;
font-size: 3em;
margin-right: 0.5em;
}
.text{
margin: 1em auto;
width: var(--page-width);
font-size: 1.5em;
}
</style>
</head>
<body>
<div class="content">
<div class="header" >
<h1><span class="emoji">🔦</span> Not Found</h1>
</div>
<div class="text">
<p>404 - Seite nicht gefunden.</p>
<p>404 - Page not found.</p>
</div>
</div>
</body>
</html>