From b0fcf5c5a40e6b16e5a71adc93c081c2afce7eea Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 28 Aug 2017 08:49:16 +0200 Subject: Initial commit. --- customization/errorpage/400.shtml | 6 ++++++ customization/errorpage/401.shtml | 6 ++++++ customization/errorpage/403.shtml | 6 ++++++ customization/errorpage/404.shtml | 6 ++++++ customization/errorpage/405.shtml | 6 ++++++ customization/errorpage/408.shtml | 6 ++++++ customization/errorpage/409.shtml | 6 ++++++ customization/errorpage/410.shtml | 6 ++++++ customization/errorpage/411.shtml | 6 ++++++ customization/errorpage/412.shtml | 6 ++++++ customization/errorpage/413.shtml | 6 ++++++ customization/errorpage/414.shtml | 6 ++++++ customization/errorpage/415.shtml | 6 ++++++ customization/errorpage/429.shtml | 7 +++++++ customization/errorpage/500.shtml | 6 ++++++ customization/errorpage/501.shtml | 6 ++++++ customization/errorpage/503.shtml | 6 ++++++ customization/errorpage/504.shtml | 6 ++++++ customization/errorpage/footer.shtml | 3 +++ customization/errorpage/header.shtml | 37 ++++++++++++++++++++++++++++++++++++ readme.md | 13 +++++++++++++ snippets/errorpage.conf | 24 +++++++++++++++++++++++ 22 files changed, 186 insertions(+) create mode 100644 customization/errorpage/400.shtml create mode 100644 customization/errorpage/401.shtml create mode 100644 customization/errorpage/403.shtml create mode 100644 customization/errorpage/404.shtml create mode 100644 customization/errorpage/405.shtml create mode 100644 customization/errorpage/408.shtml create mode 100644 customization/errorpage/409.shtml create mode 100644 customization/errorpage/410.shtml create mode 100644 customization/errorpage/411.shtml create mode 100644 customization/errorpage/412.shtml create mode 100644 customization/errorpage/413.shtml create mode 100644 customization/errorpage/414.shtml create mode 100644 customization/errorpage/415.shtml create mode 100644 customization/errorpage/429.shtml create mode 100644 customization/errorpage/500.shtml create mode 100644 customization/errorpage/501.shtml create mode 100644 customization/errorpage/503.shtml create mode 100644 customization/errorpage/504.shtml create mode 100644 customization/errorpage/footer.shtml create mode 100644 customization/errorpage/header.shtml create mode 100644 readme.md create mode 100644 snippets/errorpage.conf diff --git a/customization/errorpage/400.shtml b/customization/errorpage/400.shtml new file mode 100644 index 0000000..90e2e15 --- /dev/null +++ b/customization/errorpage/400.shtml @@ -0,0 +1,6 @@ + + + + +
Your browser (or proxy) sent a request that this server could not understand.
+ \ No newline at end of file diff --git a/customization/errorpage/401.shtml b/customization/errorpage/401.shtml new file mode 100644 index 0000000..d6cfe68 --- /dev/null +++ b/customization/errorpage/401.shtml @@ -0,0 +1,6 @@ + + + + +
This server could not verify that you are authorized to access this resource.
+ \ No newline at end of file diff --git a/customization/errorpage/403.shtml b/customization/errorpage/403.shtml new file mode 100644 index 0000000..fb59017 --- /dev/null +++ b/customization/errorpage/403.shtml @@ -0,0 +1,6 @@ + + + + +
You don't have permission to access the requested resource.
+ \ No newline at end of file diff --git a/customization/errorpage/404.shtml b/customization/errorpage/404.shtml new file mode 100644 index 0000000..714e4e0 --- /dev/null +++ b/customization/errorpage/404.shtml @@ -0,0 +1,6 @@ + + + + +
The requested resource was not found on this server.
+ \ No newline at end of file diff --git a/customization/errorpage/405.shtml b/customization/errorpage/405.shtml new file mode 100644 index 0000000..2e699cc --- /dev/null +++ b/customization/errorpage/405.shtml @@ -0,0 +1,6 @@ + + + + +
The request method, with which the server has been requested is not allowed.
+ \ No newline at end of file diff --git a/customization/errorpage/408.shtml b/customization/errorpage/408.shtml new file mode 100644 index 0000000..09ed971 --- /dev/null +++ b/customization/errorpage/408.shtml @@ -0,0 +1,6 @@ + + + + +
The server closed the network connection because the client didn't finish the request within the specified time.
+ \ No newline at end of file diff --git a/customization/errorpage/409.shtml b/customization/errorpage/409.shtml new file mode 100644 index 0000000..c59360c --- /dev/null +++ b/customization/errorpage/409.shtml @@ -0,0 +1,6 @@ + + + + +
The request could not be completed due to a conflict with the current state of the resource.
+ \ No newline at end of file diff --git a/customization/errorpage/410.shtml b/customization/errorpage/410.shtml new file mode 100644 index 0000000..ac56756 --- /dev/null +++ b/customization/errorpage/410.shtml @@ -0,0 +1,6 @@ + + + + +
The requested resource is no longer available on this server and there is no forwarding address.
+ \ No newline at end of file diff --git a/customization/errorpage/411.shtml b/customization/errorpage/411.shtml new file mode 100644 index 0000000..253c59e --- /dev/null +++ b/customization/errorpage/411.shtml @@ -0,0 +1,6 @@ + + + + +
The request method, with which the server has been requested requires a valid Content-Length header.
+ \ No newline at end of file diff --git a/customization/errorpage/412.shtml b/customization/errorpage/412.shtml new file mode 100644 index 0000000..ac3cf35 --- /dev/null +++ b/customization/errorpage/412.shtml @@ -0,0 +1,6 @@ + + + + +
The precondition on the request for the URL failed positive evaluation.
+ \ No newline at end of file diff --git a/customization/errorpage/413.shtml b/customization/errorpage/413.shtml new file mode 100644 index 0000000..4814ee4 --- /dev/null +++ b/customization/errorpage/413.shtml @@ -0,0 +1,6 @@ + + + + +
The request method, with which the server has been requested does not allow the data transmitted, or the data volume exceeds the capacity limit.
+ \ No newline at end of file diff --git a/customization/errorpage/414.shtml b/customization/errorpage/414.shtml new file mode 100644 index 0000000..f3ad112 --- /dev/null +++ b/customization/errorpage/414.shtml @@ -0,0 +1,6 @@ + + + + +
The length of the requested URL exceeds the capacity limit for this server. The request cannot be processed.
+ \ No newline at end of file diff --git a/customization/errorpage/415.shtml b/customization/errorpage/415.shtml new file mode 100644 index 0000000..939ff24 --- /dev/null +++ b/customization/errorpage/415.shtml @@ -0,0 +1,6 @@ + + + + +
The server does not support the media type transmitted in the request.
+ \ No newline at end of file diff --git a/customization/errorpage/429.shtml b/customization/errorpage/429.shtml new file mode 100644 index 0000000..cc2b31f --- /dev/null +++ b/customization/errorpage/429.shtml @@ -0,0 +1,7 @@ + + + + +
The server has detected an unusually high number of requests from your network address + and will not process further requests until the flooding has subsided.
+ \ No newline at end of file diff --git a/customization/errorpage/500.shtml b/customization/errorpage/500.shtml new file mode 100644 index 0000000..6214974 --- /dev/null +++ b/customization/errorpage/500.shtml @@ -0,0 +1,6 @@ + + + + +
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
+ \ No newline at end of file diff --git a/customization/errorpage/501.shtml b/customization/errorpage/501.shtml new file mode 100644 index 0000000..3760c9f --- /dev/null +++ b/customization/errorpage/501.shtml @@ -0,0 +1,6 @@ + + + + +
The server does not support the action requested by the client.
+ \ No newline at end of file diff --git a/customization/errorpage/503.shtml b/customization/errorpage/503.shtml new file mode 100644 index 0000000..67e6861 --- /dev/null +++ b/customization/errorpage/503.shtml @@ -0,0 +1,6 @@ + + + + +
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
+ \ No newline at end of file diff --git a/customization/errorpage/504.shtml b/customization/errorpage/504.shtml new file mode 100644 index 0000000..1764e5d --- /dev/null +++ b/customization/errorpage/504.shtml @@ -0,0 +1,6 @@ + + + + +
The gateway did not receive a timely response from the upstream server or application.
+ \ No newline at end of file diff --git a/customization/errorpage/footer.shtml b/customization/errorpage/footer.shtml new file mode 100644 index 0000000..8959bbd --- /dev/null +++ b/customization/errorpage/footer.shtml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/customization/errorpage/header.shtml b/customization/errorpage/header.shtml new file mode 100644 index 0000000..0c0a526 --- /dev/null +++ b/customization/errorpage/header.shtml @@ -0,0 +1,37 @@ + + + + + + + <!--#echo var="ERRORPAGE_CODE" --> <!--#echo var="ERRORPAGE_TEXT" --> + + +
+

diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..7a4328d --- /dev/null +++ b/readme.md @@ -0,0 +1,13 @@ +# Errorpage customization for nginx HTTP server +This package configures your nginx HTTP server with custom error pages. + +## SSI variables +The following variables are defined within each `xxx.shtml` file within the `customization/errorpage/` directory: + +* `ERRORPAGE_CODE`: This variable contains the HTTP status code for the current error or information page. +* `ERRORPAGE_TEXT`: This variable contains the description of the HTTP status code defined with `ERRORPAGE_CODE`. + +## Installation +All files and directories provided in this package are relative to the `/etc/nginx/` install directory (if your nginx is installed somewhere else, you have to change the paths). To activate the configuration, just include the `errorpage.conf` in each virtual host within the `server {}` or `location {}` block and reload nginx: + + include /etc/nginx/snippets/errorpage.conf; \ No newline at end of file diff --git a/snippets/errorpage.conf b/snippets/errorpage.conf new file mode 100644 index 0000000..16ce288 --- /dev/null +++ b/snippets/errorpage.conf @@ -0,0 +1,24 @@ +error_page 400 /errorpage/400.shtml; +error_page 401 /errorpage/401.shtml; +error_page 403 /errorpage/403.shtml; +error_page 404 /errorpage/404.shtml; +error_page 405 /errorpage/405.shtml; +error_page 408 /errorpage/408.shtml; +error_page 409 /errorpage/409.shtml; +error_page 410 /errorpage/410.shtml; +error_page 411 /errorpage/411.shtml; +error_page 412 /errorpage/412.shtml; +error_page 413 /errorpage/413.shtml; +error_page 414 /errorpage/414.shtml; +error_page 415 /errorpage/415.shtml; +error_page 429 /errorpage/429.shtml; +error_page 500 /errorpage/500.shtml; +error_page 501 /errorpage/501.shtml; +error_page 503 /errorpage/503.shtml; +error_page 504 /errorpage/504.shtml; + +location /errorpage/ { + alias /etc/nginx/customization/errorpage/; + internal; + ssi on; +} \ No newline at end of file -- cgit v1.2.3