原配置:location / {
rewrite ^/(.*).html$ /$1.html?mode=test last; error_page 404 = @nodejs; }
修改后:
location / {
root /path/to/files;
index index.html;
#try_files $uri /index.html;
if ($query_string !~ mode=test) {
rewrite ^/(.*)\.html$ /$1.html?mode=test redirect;
}
}