mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
090767ba6b | |||
a040c913e7 | |||
5ab113ba1a | |||
ea46e9f738 | |||
aeb6018a57 | |||
158856bebd |
@ -4,6 +4,13 @@ All notable changes to this package will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].
|
||||
|
||||
## v1.3.0
|
||||
|
||||
### Added
|
||||
|
||||
- `418` status code error page
|
||||
- Set `server_tokens off;` in `nginx` server configuration
|
||||
|
||||
## v1.2.0
|
||||
|
||||
### Fixed
|
||||
|
59
README.md
59
README.md
@ -65,7 +65,7 @@ Name | Description
|
||||
Execute in your shell:
|
||||
|
||||
```bash
|
||||
$ docker run --rm -p "8082:8080" tarampampam/error-pages:1.2.0
|
||||
$ docker run --rm -p "8082:8080" tarampampam/error-pages:1.3.0
|
||||
```
|
||||
|
||||
And open in your browser `http://127.0.0.1:8082/ghost/400.html`.
|
||||
@ -106,7 +106,7 @@ FROM nginx:1.18-alpine
|
||||
COPY --chown=nginx \
|
||||
./nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --chown=nginx \
|
||||
--from=tarampampam/error-pages:1.2.0 \
|
||||
--from=tarampampam/error-pages:1.3.0 \
|
||||
/opt/html/ghost /usr/share/nginx/errorpages/_error-pages
|
||||
```
|
||||
|
||||
@ -117,37 +117,52 @@ COPY --chown=nginx \
|
||||
Simple traefik (tested on `v2.2.1`) service configuration for usage in [docker swarm][link_swarm] (**change with your needs**):
|
||||
|
||||
```yaml
|
||||
version: '3.8'
|
||||
version: '3.4'
|
||||
|
||||
services:
|
||||
error-pages:
|
||||
image: tarampampam/error-pages:1.2.0
|
||||
image: tarampampam/error-pages:1.3.0
|
||||
environment:
|
||||
TEMPLATE_NAME: ghost
|
||||
TEMPLATE_NAME: l7-dark
|
||||
networks:
|
||||
- traefik-public
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- node.role == worker
|
||||
max_replicas_per_node: 1
|
||||
resources:
|
||||
limits:
|
||||
memory: 32M
|
||||
reservations:
|
||||
memory: 16M
|
||||
labels:
|
||||
- traefik.enable: true
|
||||
- traefik.docker.network: traefik-public
|
||||
- traefik.http.routers.error-pages-router.rule: HostRegexp(`{host:.+}`)
|
||||
- traefik.http.routers.error-pages-router.tls: true
|
||||
- traefik.http.routers.error-pages-router.priority: 10
|
||||
- traefik.http.routers.error-pages-router.entrypoints: https
|
||||
- traefik.http.routers.error-pages-router.middlewares: error-pages-middleware@docker
|
||||
- traefik.http.services.error-pages-service.loadbalancer.server.port: 8080
|
||||
- traefik.http.middlewares.error-pages-middleware.errors.status: 400-599
|
||||
- traefik.http.middlewares.error-pages-middleware.errors.service: error-pages-service@docker
|
||||
- traefik.http.middlewares.error-pages-middleware.errors.query: /{status}.html
|
||||
traefik.enable: 'true'
|
||||
traefik.docker.network: traefik-public
|
||||
# use as "fallback" for any non-registered services (with priority below normal)
|
||||
traefik.http.routers.error-pages-router.rule: HostRegexp(`{host:.+}`)
|
||||
traefik.http.routers.error-pages-router.priority: 10
|
||||
# should say that all of your services work on https
|
||||
traefik.http.routers.error-pages-router.tls: 'true'
|
||||
traefik.http.routers.error-pages-router.entrypoints: https
|
||||
traefik.http.routers.error-pages-router.middlewares: error-pages-middleware@docker
|
||||
traefik.http.services.error-pages-service.loadbalancer.server.port: 8080
|
||||
# "errors" middleware settings
|
||||
traefik.http.middlewares.error-pages-middleware.errors.status: 400-599
|
||||
traefik.http.middlewares.error-pages-middleware.errors.service: error-pages-service@docker
|
||||
traefik.http.middlewares.error-pages-middleware.errors.query: /{status}.html
|
||||
|
||||
any-another-http-service:
|
||||
image: nginx:alpine
|
||||
networks:
|
||||
- traefik-public
|
||||
deploy:
|
||||
placement:
|
||||
constraints:
|
||||
- node.role == worker
|
||||
labels:
|
||||
traefik.enable: 'true'
|
||||
traefik.docker.network: traefik-public
|
||||
traefik.http.routers.another-service.rule: Host(`subdomain.example.com`)
|
||||
traefik.http.routers.another-service.tls: 'true'
|
||||
traefik.http.routers.another-service.entrypoints: https
|
||||
# next line is important
|
||||
traefik.http.routers.another-service.middlewares: error-pages-middleware@docker
|
||||
traefik.http.services.another-service.loadbalancer.server.port: 80
|
||||
|
||||
networks:
|
||||
traefik-public:
|
||||
|
@ -82,6 +82,11 @@
|
||||
"message": "Requested Range Not Satisfiable",
|
||||
"description": "The requested byte range is not available and is out of bounds"
|
||||
},
|
||||
{
|
||||
"code": 418,
|
||||
"message": "I'm a teapot",
|
||||
"description": "Attempt to brew coffee with a teapot is not supported"
|
||||
},
|
||||
{
|
||||
"code": 429,
|
||||
"message": "Too Many Requests",
|
||||
|
@ -2,6 +2,8 @@ server {
|
||||
listen 8080;
|
||||
server_name _;
|
||||
|
||||
server_tokens off;
|
||||
|
||||
index index.html index.htm;
|
||||
root /opt/html;
|
||||
|
||||
|
Reference in New Issue
Block a user