有人可以解釋為什么以下條件失敗嗎?好像最后一個)被切斷了。
location / {
if ($request_uri !~ "(abc|def)" {
return 404;
}
...
失敗:
2021/10/07 13:29:50 [emerg] 183#183: pcre_compile() failed: missing ) in "(abc|def" in /usr/local/openresty/nginx/conf/conf.d/local.dev.conf:26
nginx: [emerg] pcre_compile() failed: missing ) in "(abc|def" in /usr/local/openresty/nginx/conf/conf.d/local.dev.conf:26
有趣的是,這似乎是“有效的”。
if ($request_uri !~ "(abc|def))" {
return 404;
}
uj5u.com熱心網友回復:
你錯過)了if (.
if ($request_uri !~ "(abc|def)") {
return 404;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/315309.html
