Skip to content

PecceG2/HTML_Template_http_codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License


Logo

HTML Templates for HTTP status codes

HTML Template HTTP Codes is a HTML templates to decorate your HTTP web server responses/errors
Change default nginx/apache templates for a responsive and more attractive design
View all my projects »

Report Bug · View License · Request Feature

Screenshots

Screenshot

Templates demo

Usage

Just clone/download the git repository (The html files are included on error number folder, example "500/index.html" for 500 Internal Server Error)

NGINX Integration

NGINX supports custom error-pages using multiple error_page directives.

File: nginx.conf (/etc/nginx/)

Example - assumes HttpErrorPages are located into /var/html/www/ErrorPages.

server {
    listen      80;
    server_name localhost;
    root        /var/html/www;
    index       index.html;
    
    location / {
        try_files $uri $uri/ =404;
        
        # add one directive for each http status code
        error_page 404 /ErrorPages/404/index.html;
        error_page 500 /ErrorPages/500/index.html;
        error_page 503 /ErrorPages/503/index.html;
		error_page 503 /ErrorPages/504/index.html;
    }

    # redirect the virtual ErrorPages path the real path
    location /ErrorPages/ {
        alias /var/html/www/ErrorPages/;
        internal;
    }

Apache Httpd Integration

Apache Httpd 2.x supports custom error-pages using multiple ErrorDocument directives.

File: httpd.conf or .htaccess

Example - assumes HttpErrorPages are located into your document root /var/www/...docroot../ErrorPages.

ErrorDocument 404 /ErrorPages/404/index.html
ErrorDocument 500 /ErrorPages/500/index.html
ErrorDocument 503 /ErrorPages/503/index.html
ErrorDocument 504 /ErrorPages/504/index.html

License

You can check out the full license here

This project is licensed under the terms of the MIT license.