我在Nginx配置中有两个位置:
/ API / *
和
/ API /货币/ for_banki_ru / V1 / *
我需要关闭/ api / *的访问权限以及/ api / currency / for_banki_ru / v1 / *的所有人的开放访问权限。
现在我的配置中有
location ~* ^/api/
{
allow *************** - here IP;
deny all;
***********************
并且
location ~* ^/api/currencies/for_banki_ru/v1/
{
allow all;
***************
结果/ api / - 已关闭,但/ api / currency / for_banki_ru / v1 /已关闭 - 在Nginx日志中有错误:
6760#7308: *235126 access forbidden by rule, client: **********, server: **********, request: "GET /api/currencies/for_banki_ru/v1/index.php HTTP/1.1"
如何开放访问/ api / currency / for_banki_ru / v1 / *?
答案 0 :(得分:0)
通过将所需的API移动到另一个URL /目录来解决。