我想摆脱这些工作规则
location = /contact {
rewrite ^(.*)$ /index.php?v=contact last; break;
}
location = /terms {
rewrite ^(.*)$ /index.php?v=terms last; break;
}
location = /faq {
rewrite ^(.*)$ /index.php?v=faq last; break;
}
location = /twitter {
rewrite ^(.*)$ /index.php?v2=twitter last; break;
}
location = /facebook {
rewrite ^(.*)$ /index.php?v2=facebook last; break;
}
location = /login {
rewrite ^(.*)$ /index.php?v2=login last; break;
}
location = /privacy {
rewrite ^(.*)$ /index.php?v=privacy last; break;
}
像这样
location / {
try_files $uri $uri/ =404;
rewrite ^/(contact|privacy|terms|faq)$ /index.php?v=$1 last;
rewrite ^/(twitter|facebook|login)$ /index.php?v2=$1 last; break;
}
但问题是“联系”、“条款”、“隐私”、“推特”、“脸书”页面工作正常,但“隐私”和“登录”页面抛出 404 错误。
没有其他涉及“登录”和“隐私”的重写规则