![NGINX 自定义错误页面无法工作](https://linux22.com/image/804960/NGINX%20%E8%87%AA%E5%AE%9A%E4%B9%89%E9%94%99%E8%AF%AF%E9%A1%B5%E9%9D%A2%E6%97%A0%E6%B3%95%E5%B7%A5%E4%BD%9C.png)
我的服务器不想显示自定义的 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 {
} }
有人知道为什么服务器无法处理这个错误页面吗?