Skip to content

tomek/nginx-cats-error-pages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Cat error pages for Nginx

Was bored, made this see notes.

Installation

###1st method

Easiest way is to put error/ folder into your webserver root dir add f.e. error_page 404 =/404.html; to config, restart and it should work.

###2nd method

If you want to server error pages from different dir you need to add this to your config: (there's probably better way to do this but I'm too lazy to check).

   error_page 404 /404.html;

   location = /404.html; {
   root /your/path/to/file/dir;
   }
   location = /koty.css; { 
   root /your/path/to/file/dir; 
   }
   location = /koty/404.jpg; {
   root /your/path/to/file/dir;
   }

I didn't like this method so I just created new vhost to serve css/imgs, edited htmls with links to vhost - you can see it in action here error 404 and error 401 (just click cancel when prompted for pass)

Notes

All cats images are taken from here and are licensed under the CC Attribution license.

About

Error pages for nginx with cats

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published