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后缀的
}

原文地址:https://www.cnblogs.com/byfboke/p/9936479.html