Logo

Armand.nz

Home / About / Linkedin / Github

NGINX Custom error pages

#nginx #errors |

A NGINX Configuration to point to custom error pages

server {
	# ...
	
	# Path for static files
	root html/Shoppe-static;
	# Custom Error Pages (These pages do not depend on any local css,images,js etc )
	error_page 403 /error/403.html;
	error_page 404 /error/404.html;
	error_page 500 /error/500.html;
	error_page 503 /error/503.html;
	error_page 504 /error/504.html;
	
	# External clients cannot request these error pages only nginx can...
	location ^~ /error/ {
		internal;
		# ...
	}

Here are some nice HTML error page templates:

comments powered byDisqus

Copyright © Armand