Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ai3
float
Commits
e0793e59
Commit
e0793e59
authored
Jun 09, 2019
by
ale
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'nice-errors' into 'master'
Display nice HTTP error pages where possible See merge request
!34
parents
091515ec
0ea6f121
Pipeline
#3338
passed with stage
in 6 minutes and 6 seconds
Changes
12
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
254 additions
and
1 deletion
+254
-1
roles/nginx/files/errors/429.html
roles/nginx/files/errors/429.html
+34
-0
roles/nginx/files/errors/451.html
roles/nginx/files/errors/451.html
+33
-0
roles/nginx/files/errors/500.html
roles/nginx/files/errors/500.html
+39
-0
roles/nginx/files/errors/502.html
roles/nginx/files/errors/502.html
+39
-0
roles/nginx/files/errors/503.html
roles/nginx/files/errors/503.html
+39
-0
roles/nginx/files/errors/504.html
roles/nginx/files/errors/504.html
+39
-0
roles/nginx/files/errors/Rstar22-t.png
roles/nginx/files/errors/Rstar22-t.png
+0
-0
roles/nginx/files/errors/bomb-small-c.png
roles/nginx/files/errors/bomb-small-c.png
+0
-0
roles/nginx/tasks/nginx.yml
roles/nginx/tasks/nginx.yml
+11
-0
roles/nginx/templates/config/conf.d/proxy.conf
roles/nginx/templates/config/conf.d/proxy.conf
+1
-1
roles/nginx/templates/config/snippets/custom-errors.conf
roles/nginx/templates/config/snippets/custom-errors.conf
+18
-0
roles/nginx/templates/nginx-vhost.j2
roles/nginx/templates/nginx-vhost.j2
+1
-0
No files found.
roles/nginx/files/errors/429.html
0 → 100644
View file @
e0793e59
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
429 - Rate limited
</title>
<style
type=
"text/css"
>
body
{
color
:
black
;
background-color
:
#ddd
;
font-size
:
1.3em
;
font-family
:
"Times New Roman"
,
"Georgia"
,
serif
;
}
#main
{
width
:
60%
;
margin
:
10%
auto
;
text-align
:
center
;
}
h1
{
font-weight
:
normal
;
}
a
:link
{
font-weight
:
bold
;
}
img
{
border
:
0
;
}
.rstar
{
margin-bottom
:
-4px
;
}
</style>
</head>
<body>
<div
id=
"main"
>
<img
src=
"/__errors/bomb-small-c.png"
alt=
""
/>
<h1>
too many requests
</h1>
<p>
You sent too many requests for a protected URL
in a short amount of time. Wait a while and
try again later.
</p>
</div>
</body>
</html>
roles/nginx/files/errors/451.html
0 → 100644
View file @
e0793e59
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
451 - Unavailable For Legal Reasons
</title>
<style
type=
"text/css"
>
body
{
color
:
black
;
background-color
:
#ddd
;
font-size
:
1.3em
;
font-family
:
"Times New Roman"
,
"Georgia"
,
serif
;
}
#main
{
width
:
60%
;
margin
:
10%
auto
;
text-align
:
center
;
}
h1
{
font-weight
:
normal
;
}
a
:link
{
font-weight
:
bold
;
}
img
{
border
:
0
;
}
.rstar
{
margin-bottom
:
-4px
;
}
</style>
</head>
<body>
<div
id=
"main"
>
<img
src=
"/__errors/bomb-small-c.png"
alt=
""
/>
<h1>
Unavailable for legal reasons
</h1>
<p>
This request may not be serviced because some
law court has ordered us not to show it to you.
</p>
</div>
</body>
</html>
roles/nginx/files/errors/500.html
0 → 100644
View file @
e0793e59
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
500 - Internal Server Error
</title>
<style
type=
"text/css"
>
body
{
color
:
black
;
background-color
:
#ddd
;
font-size
:
1.3em
;
font-family
:
"Times New Roman"
,
"Georgia"
,
serif
;
}
#main
{
width
:
60%
;
margin
:
10%
auto
;
text-align
:
center
;
}
h1
{
font-weight
:
normal
;
}
a
:link
{
font-weight
:
bold
;
}
img
{
border
:
0
;
}
.rstar
{
margin-bottom
:
-4px
;
}
</style>
</head>
<body>
<div
id=
"main"
>
<img
src=
"/__errors/bomb-small-c.png"
alt=
""
/>
<h1>
the site has an error :-(
</h1>
<p>
Something went wrong...
<br>
maybe you could try again later.
</p>
<p>
Perhaps maintenance is ongoing?
<br>
Check out
<a
href=
"https://cavallette.noblogs.org/"
>
our blog
</a>
<img
src=
"/__errors/Rstar22-t.png"
class=
"rstar"
>
</p>
</div>
</body>
</html>
roles/nginx/files/errors/502.html
0 → 100644
View file @
e0793e59
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
502 - Server timed out
</title>
<style
type=
"text/css"
>
body
{
color
:
black
;
background-color
:
#ddd
;
font-size
:
1.3em
;
font-family
:
"Times New Roman"
,
"Georgia"
,
serif
;
}
#main
{
width
:
60%
;
margin
:
10%
auto
;
text-align
:
center
;
}
h1
{
font-weight
:
normal
;
}
a
:link
{
font-weight
:
bold
;
}
img
{
border
:
0
;
}
.rstar
{
margin-bottom
:
-4px
;
}
</style>
</head>
<body>
<div
id=
"main"
>
<img
src=
"/__errors/bomb-small-c.png"
alt=
""
/>
<h1>
the server timed out :-(
</h1>
<p>
Something went wrong...
<br>
maybe you could try again later.
</p>
<p>
Perhaps maintenance is ongoing?
<br>
Check out
<a
href=
"https://cavallette.noblogs.org/"
>
our blog
</a>
<img
src=
"/__errors/Rstar22-t.png"
class=
"rstar"
>
</p>
</div>
</body>
</html>
roles/nginx/files/errors/503.html
0 → 100644
View file @
e0793e59
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
503 - Service unavailable
</title>
<style
type=
"text/css"
>
body
{
color
:
black
;
background-color
:
#ddd
;
font-size
:
1.3em
;
font-family
:
"Times New Roman"
,
"Georgia"
,
serif
;
}
#main
{
width
:
60%
;
margin
:
10%
auto
;
text-align
:
center
;
}
h1
{
font-weight
:
normal
;
}
a
:link
{
font-weight
:
bold
;
}
img
{
border
:
0
;
}
.rstar
{
margin-bottom
:
-4px
;
}
</style>
</head>
<body>
<div
id=
"main"
>
<img
src=
"/__errors/bomb-small-c.png"
alt=
""
/>
<h1>
service unavailable :-(
</h1>
<p>
Something went wrong...
<br>
maybe you could try again later.
</p>
<p>
Maintenance seems to be ongoing.
<br>
Check out
<a
href=
"https://cavallette.noblogs.org/"
>
our blog
</a>
<img
src=
"/__errors/Rstar22-t.png"
class=
"rstar"
>
</p>
</div>
</body>
</html>
roles/nginx/files/errors/504.html
0 → 100644
View file @
e0793e59
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
504 - Gateway timeout
</title>
<style
type=
"text/css"
>
body
{
color
:
black
;
background-color
:
#ddd
;
font-size
:
1.3em
;
font-family
:
"Times New Roman"
,
"Georgia"
,
serif
;
}
#main
{
width
:
60%
;
margin
:
10%
auto
;
text-align
:
center
;
}
h1
{
font-weight
:
normal
;
}
a
:link
{
font-weight
:
bold
;
}
img
{
border
:
0
;
}
.rstar
{
margin-bottom
:
-4px
;
}
</style>
</head>
<body>
<div
id=
"main"
>
<img
src=
"/__errors/bomb-small-c.png"
alt=
""
/>
<h1>
service unavailable :-(
</h1>
<p>
Something went wrong...
<br>
maybe you could try again later.
</p>
<p>
Maintenance seems to be ongoing.
<br>
Check out
<a
href=
"https://cavallette.noblogs.org/"
>
our blog
</a>
<img
src=
"/__errors/Rstar22-t.png"
class=
"rstar"
>
</p>
</div>
</body>
</html>
roles/nginx/files/errors/Rstar22-t.png
0 → 100644
View file @
e0793e59
767 Bytes
roles/nginx/files/errors/bomb-small-c.png
0 → 100644
View file @
e0793e59
5.63 KB
roles/nginx/tasks/nginx.yml
View file @
e0793e59
...
...
@@ -148,6 +148,17 @@
src
:
favicon.ico
dest
:
/var/www/html/favicon.ico
-
name
:
Create the custom error directory
file
:
path
:
/var/www/html/__errors
state
:
directory
-
name
:
Copy custom error messages
copy
:
src
:
"
{{
item
}}"
dest
:
/var/www/html/__errors/
with_fileglob
:
"
errors/*"
# Create the cache directory.
-
file
:
path
:
/var/cache/nginx
...
...
roles/nginx/templates/config/conf.d/proxy.conf
View file @
e0793e59
...
...
@@ -29,4 +29,4 @@ proxy_cache_valid 404 1m;
proxy_cache_min_uses
2
;
# Show our own error pages, not the remote ones.
#
proxy_intercept_errors on;
proxy_intercept_errors
on
;
roles/nginx/templates/config/snippets/custom-errors.conf
0 → 100644
View file @
e0793e59
# Global error pages.
location
/
__
errors
{
root
/
var
/
www
/
html
;
allow
all
;
internal
;
}
# Needed otherwise the image-caching directives for noblogs take precedence.
location
~* ^/
__
errors
/(.*\.
png
)$ {
alias
/
var
/
www
/
html
/
__
errors
/$
1
;
}
error_page
500
/
__
errors
/
500
.
html
;
error_page
502
/
__
errors
/
502
.
html
;
error_page
503
/
__
errors
/
503
.
html
;
error_page
504
/
__
errors
/
504
.
html
;
error_page
429
/
__
errors
/
429
.
html
;
error_page
451
/
__
errors
/
451
.
html
;
roles/nginx/templates/nginx-vhost.j2
View file @
e0793e59
...
...
@@ -35,6 +35,7 @@ server {
ssl_certificate_key /etc/credentials/public/{{ endpoint.name }}.{{ domain_public[0] }}/privkey.pem;
include /etc/nginx/snippets/site-limits.conf;
include /etc/nginx/snippets/custom-errors.conf;
location = /favicon.ico {
expires 15d;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment