NGINX 自定义错误页面无法工作

NGINX 自定义错误页面无法工作

我的服务器不想显示自定义的 500 错误页面。

500错误的错误页面在这里:

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

这些是我的虚拟主机配置:

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;
    }

}

服务器 { 监听 443; }

    #Errorpages

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

    location ~ /\.ht {

} }

有人知道为什么服务器无法处理这个错误页面吗?

相关内容