mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-07-01 06:15:45 +00:00
feat: custom default error page (#2430)
* feat: customizable error page * fix: use regex on catchall root location to fix DEFAULT_ROOT=none test * docs: custom error pages * fix: don't use default nginx image error page * docs: small fix
This commit is contained in:
23
test/test_custom-error-page/50x.html
Normal file
23
test/test_custom-error-page/50x.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Maintenance</title>
|
||||
<style>
|
||||
html {
|
||||
color-scheme: light dark;
|
||||
}
|
||||
body {
|
||||
width: 35em;
|
||||
margin: 0 auto;
|
||||
font-family: Tahoma, Verdana, Arial, sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Damn, there's some maintenance in progress.</h1>
|
||||
<p>
|
||||
Our apologies for this temporary inconvenience. Regular service
|
||||
performance will be re-established shortly.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
8
test/test_custom-error-page/test_custom-error-page.py
Normal file
8
test/test_custom-error-page/test_custom-error-page.py
Normal file
@ -0,0 +1,8 @@
|
||||
import pytest
|
||||
import re
|
||||
|
||||
|
||||
def test_custom_error_page(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://unknown.nginx-proxy.tld")
|
||||
assert r.status_code == 503
|
||||
assert re.search(r"Damn, there's some maintenance in progress.", r.text)
|
8
test/test_custom-error-page/test_custom-error-page.yml
Normal file
8
test/test_custom-error-page/test_custom-error-page.yml
Normal file
@ -0,0 +1,8 @@
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
sut:
|
||||
image: nginxproxy/nginx-proxy:test
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
- ./50x.html:/usr/share/nginx/html/errors/50x.html:ro
|
Reference in New Issue
Block a user