我想限制一个nginx服务器到一个目录,例如/在这种情况下。 我会推测这是这样的,但它不起作用。
location ~ !(^/example) { return 403; }
server { # other server directives deny all; location /example { allow all; # other location directives } }