nginx判断为404跳转

Posted 天宇星空

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx判断为404跳转相关的知识,希望对你有一定的参考价值。

server {
listen 80;
server_name localhost www.beautysaas.com 120.26.126.123;
error_page 404 = http://www.beautysaas.com/$1;   #这个不带url后缀

 

 


location / {
root html;
index index.html index.htm index.php;
try_files $uri $uri/ /index.html?$query_string;    #这个是带url后缀的
}









以上是关于nginx判断为404跳转的主要内容,如果未能解决你的问题,请参考以下文章