Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

My Server doesn't want to display a custom 500 error page.

The error page for the 500 error is here:

these are my vhost configs:

server {
    listen   80; ## listen for ipv4; this line is default and implied
    #listen   [::]:80 default ipv6only=on; ## listen for ipv6
    root /usr/share/nginx/www;

    # pass the PHP scripts to FastCGI server listening on
    location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/tmp/php5-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    location ~ /\.ht {
            deny all;


server { listen 443; }


    error_page 500 /500.html;
    location = /errorpages/500-504/500.html {
       root  /usr/share/nginx/www;

    location ~ /\.ht {

} }

Does anyone have any idea why the server does not work with this error page?

share|improve this question
Could you try changing location to '/500.html' and root to '/usr/share/nginx/www/errorpages/500-504;' – sgtbeano Oct 31 '13 at 11:47
now i got it like this: error_page 500 /500.html; location = /500.html { root /usr/share/nginx/www/errorpages/500-504/;} also does not work at all! How to fix this sh** – Robin van der Linden Oct 31 '13 at 12:03
Can you paste your full config please – sgtbeano Oct 31 '13 at 12:13

Your Answer


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

Browse other questions tagged or ask your own question.