Error Pages

Error pages should be built such that they require zero scripting, zero javascript, zero templating, and zero dependency on anything whatsoever. That means static HTML with inline CSS and base64-encoded images.

The following are banned from every error page:

  • All <script> tags with a src attribute.
  • All JavaScript that loads external data.
  • All <link> tags.
  • All <img> tags with a src pointing to a URL.


I am currently making an exception to the external resource rule by including a google script that adds a search box on the error pages. This is okay, as it should not cause the page to stop working and may allow the user to resolve the issue themselves.

Additionally, the error pages are render by Django, so they have a dependency on that framework. I should probably move some or all of them to be rendered solely by Nginx.

Template list

I have three different generic error pages, but hope to have more specific pages someday.

  • 500 — An exception occurred and the site couldn't recover (all server-side errors).
  • 404 — The requested URL was not found.
  • maintenance — For the rare case I must take the website down to perform maintenance.