diff --git a/coreos-config/compose/01_errorpage/.env b/coreos-config/compose/01_errorpage/.env new file mode 100644 index 0000000..d1f9481 --- /dev/null +++ b/coreos-config/compose/01_errorpage/.env @@ -0,0 +1 @@ +COMPOSE_PROJECT_NAME=errorpage diff --git a/coreos-config/compose/01_errorpage/default.conf b/coreos-config/compose/01_errorpage/default.conf new file mode 100644 index 0000000..d0aa76e --- /dev/null +++ b/coreos-config/compose/01_errorpage/default.conf @@ -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; + } +} diff --git a/coreos-config/compose/01_errorpage/docker-compose.yaml b/coreos-config/compose/01_errorpage/docker-compose.yaml new file mode 100644 index 0000000..2cd6fcc --- /dev/null +++ b/coreos-config/compose/01_errorpage/docker-compose.yaml @@ -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 +... diff --git a/coreos-config/compose/01_errorpage/error-pages/404.html b/coreos-config/compose/01_errorpage/error-pages/404.html new file mode 100644 index 0000000..bf83377 --- /dev/null +++ b/coreos-config/compose/01_errorpage/error-pages/404.html @@ -0,0 +1,7 @@ + + +

404

+

Page not found

+ + +