Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

The error page for the 500 error is here:

https://aixspace.de/errorpages/500-504/500.html

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 127.0.0.1:9000
    #
    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; }

    #Errorpages

    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

 
discard

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

Browse other questions tagged or ask your own question.