|
@@ -18,6 +18,8 @@ Simple HTTP Error Page Generator. Create a bunch of custom error pages - suitabl
|
|
|
## Download ##
|
|
|
Just clone/download the git repository **or** use the prebuild packages (only the generated html files are included)
|
|
|
|
|
|
+## Download Prebuild Packages (Pages only) ##
|
|
|
+
|
|
|
**Direct Download**
|
|
|
* [Download TAR Archive](https://raw.githubusercontent.com/AndiDittrich/HttpErrorPages/master/dist/pages.tar)
|
|
|
* [Download ZIP Archive](https://raw.githubusercontent.com/AndiDittrich/HttpErrorPages/master/dist/pages.zip)
|
|
@@ -31,20 +33,34 @@ wget https://raw.githubusercontent.com/AndiDittrich/HttpErrorPages/master/dist/p
|
|
|
wget https://raw.githubusercontent.com/AndiDittrich/HttpErrorPages/master/dist/pages.zip
|
|
|
```
|
|
|
|
|
|
-## Integration ##
|
|
|
+## NGINX Integration ##
|
|
|
|
|
|
-### Lighttpd ###
|
|
|
-[Lighttpd](http://www.lighttpd.net/) supports custom error-pages using the [server.errorfile-prefix](http://redmine.lighttpd.net/projects/lighttpd/wiki/Server_errorfile-prefixDetails) directive.
|
|
|
+[NGINX](http://nginx.org/en/docs/http/ngx_http_core_module.html#error_page) supports custom error-pages using multiple `error_page` directives.
|
|
|
|
|
|
-File: `lighttpd.conf`
|
|
|
+File: `default.conf`
|
|
|
|
|
|
Example - assumes HttpErrorPages are located into `/var/www/ErrorPages/`.
|
|
|
|
|
|
-```ApacheConf
|
|
|
-server.errorfile-prefix = "/var/www/ErrorPages/HTTP"
|
|
|
+```nginx
|
|
|
+# add one directive for each http status code
|
|
|
+error_page 400 /ErrorPages/HTTP400.html;
|
|
|
+error_page 401 /ErrorPages/HTTP401.html;
|
|
|
+error_page 402 /ErrorPages/HTTP402.html;
|
|
|
+error_page 403 /ErrorPages/HTTP403.html;
|
|
|
+error_page 404 /ErrorPages/HTTP404.html;
|
|
|
+error_page 500 /ErrorPages/HTTP500.html;
|
|
|
+error_page 501 /ErrorPages/HTTP501.html;
|
|
|
+error_page 502 /ErrorPages/HTTP502.html;
|
|
|
+error_page 503 /ErrorPages/HTTP503.html;
|
|
|
+
|
|
|
+# redirect the virtual ErrorPages path the real path
|
|
|
+location /ErrorPages/ {
|
|
|
+ alias /var/www/ErrorPages/;
|
|
|
+ internal;
|
|
|
+}
|
|
|
```
|
|
|
|
|
|
-### Apache Httpd ###
|
|
|
+## Apache Httpd Integration ##
|
|
|
[Apache Httpd 2.x](http://httpd.apache.org/) supports custom error-pages using multiple [ErrorDocument](http://httpd.apache.org/docs/2.4/mod/core.html#errordocument) directives.
|
|
|
|
|
|
File: `httpd.conf` or `.htaccess`
|
|
@@ -62,27 +78,16 @@ ErrorDocument 502 /ErrorPages/HTTP502.html
|
|
|
ErrorDocument 503 /ErrorPages/HTTP503.html
|
|
|
```
|
|
|
|
|
|
-File: `default.conf`
|
|
|
+## Lighttpd Integration ##
|
|
|
|
|
|
-Example - assumes HttpErrorPages are located into `/var/www/ErrorPages/`.
|
|
|
+[Lighttpd](http://www.lighttpd.net/) supports custom error-pages using the [server.errorfile-prefix](http://redmine.lighttpd.net/projects/lighttpd/wiki/Server_errorfile-prefixDetails) directive.
|
|
|
|
|
|
-```nginx
|
|
|
-# add one directive for each http status code
|
|
|
-error_page 400 /ErrorPages/HTTP400.html;
|
|
|
-error_page 401 /ErrorPages/HTTP401.html;
|
|
|
-error_page 402 /ErrorPages/HTTP402.html;
|
|
|
-error_page 403 /ErrorPages/HTTP403.html;
|
|
|
-error_page 404 /ErrorPages/HTTP404.html;
|
|
|
-error_page 500 /ErrorPages/HTTP500.html;
|
|
|
-error_page 501 /ErrorPages/HTTP501.html;
|
|
|
-error_page 502 /ErrorPages/HTTP502.html;
|
|
|
-error_page 503 /ErrorPages/HTTP503.html;
|
|
|
+File: `lighttpd.conf`
|
|
|
|
|
|
-# redirect the virtual ErrorPages path the real path
|
|
|
-location /ErrorPages/ {
|
|
|
- alias /var/www/ErrorPages/;
|
|
|
- internal;
|
|
|
-}
|
|
|
+Example - assumes HttpErrorPages are located into `/var/www/ErrorPages/`.
|
|
|
+
|
|
|
+```ApacheConf
|
|
|
+server.errorfile-prefix = "/var/www/ErrorPages/HTTP"
|
|
|
```
|
|
|
|
|
|
## Customization ##
|
|
@@ -90,7 +95,8 @@ To customize the pages, you can edit the **template.phtml** file and add your ow
|
|
|
If you wan't to add custom pages/additional error-codes, just put a new entry into the `pages.php` file. The generator-script will process each entry and generates an own page.
|
|
|
|
|
|
#### Custom Page Example (pages.php) ####
|
|
|
-Error-Codes used by CloudFlare
|
|
|
+
|
|
|
+Custom Error-Codes used by e.g. CloudFlare
|
|
|
|
|
|
```php
|
|
|
// webserver origin error
|