Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to configure globally only the http part of nginx.conf to have all sites using the same error pages, without having to add some lines to each of the sites?

I'm not talking about the error page configuration per site.
Also not talking about having the same error page shared among multiple/all sites, using aliases.

The problem with these solutions is that it requires a configuration setup per site.

share|improve this question
up vote 1 down vote accepted

According to nginx documentation error_page directive is allowed in following locations: http, server, location, if in location.

share|improve this answer
Thanks for your answer. How do you declare default error pages in the http section? – ringø May 30 '11 at 12:03
The same as in a server section. – mgorven Apr 19 '12 at 22:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.