WIP: Errorpage

This commit is contained in:
Tobias Manske 2022-08-22 23:23:14 +02:00
parent 2b55a81c7f
commit d86ea6a382
Signed by: tobias
GPG Key ID: E83C743C1FC2F79A
4 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1 @@
COMPOSE_PROJECT_NAME=errorpage

View File

@ -0,0 +1,13 @@
server {
listen 80;
server_name localhost;
error_page 404 /404.html;
# other error pages here:
# error_page 403 /403.html;
location / {
root /usr/share/nginx/error-pages;
internal;
}
}

View File

@ -0,0 +1,31 @@
---
version: '3'
services:
error:
image: nginx:latest
restart: always
volumes:
- ./error-pages:/usr/share/nginx/error-pages:ro,Z
- ./default.conf:/etc/nginx/conf.d/default.conf:ro,Z
networks:
# This is the network over which Traefik communicates with other containers.
- gateway
labels:
traefik.enable: true
traefik.http.routers.error-router.rule: Host(`*.tobiasmanske.de`)
traefik.http.routers.error-router.priority: 1
traefik.http.routers.error-router.entrypoints: websecure
traefik.http.routers.error-router.middlewares: error-pages-middleware
traefik.http.middlewares.error-pages-middleware.errors.status: 400-599
traefik.http.middlewares.error-pages-middleware.errors.service: error-pages-service
traefik.http.middlewares.error-pages-middleware.errors.query: /{status}.html
traefik.http.services.error-pages-service.loadbalancer.server.port: 80
com.centurylinklabs.watchtower.scope: update
networks:
gateway:
external: true
...

View File

@ -0,0 +1,7 @@
<html>
<body>
<h1>404</h1>
<p>Page not found</p>
</body>
</html>