Knowledgebase

How to Create Custom 404 and 500 Error Pages in Nginx Print

  • 0

Display branded error pages instead of default Nginx server error text.

Step-by-Step Instructions

  1. Create /var/www/html/404.html.
  2. Add error_page 404 /404.html; inside your server block.
  3. Reload Nginx.
error_page 404 /404.html;
location = /404.html {
  root /var/www/html;
  internal;
}

Pro Tip: Include a link back to your homepage on custom 404 pages to retain visitors.

Need assistance? Open a ticket in the A1 Client Area or contact our 24/7 NOC Engineering Team on WhatsApp at +1 (406) 229-9597.


Was this answer helpful?

« Back