65

Nginx自定义404页面,返回200状态码解决方法

 5 years ago
source link: https://www.linuxprobe.com/nginx-404-200.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
nginx.conf (nginx配置文件)

http {
...
fastcgi_intercept_errors on;
...
}

default (网站配置文件)

server {
...
error_page 404 /404.html;
...
}

如果还需要设置其他的按照格式添加即可 error_page xxx /xxx.html; 默认页面存放目录为网站根目录


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK