gpt4 book ai didi

magento - 通过 IP 限制对 Nginx 中 Magento 管理区域的访问

转载 作者:行者123 更新时间:2023-12-02 06:27:15 25 4
gpt4 key购买 nike

我试图限制对 nginx 中 magento 管理区域的访问。我们过去常在 apache 中执行以下操作,但不知道如何在 Nginx 中执行以下操作:

RewriteCond %{REMOTE_ADDR} !^116\.71\.8\.191    
RewriteCond %{REQUEST_URI} admin [NC]
RewriteRule ^(.*)$ / [F,L]

问候,

史蒂夫

最佳答案

location /admin {
allow 116.71.8.191;
# drop rest of the world
deny all;
}

不要忘记重新加载规则

/usr/local/nginx/sbin/nginx -s reload

更多信息可以在这里找到:http://www.cyberciti.biz/faq/linux-unix-nginx-access-control-howto/

关于magento - 通过 IP 限制对 Nginx 中 Magento 管理区域的访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12756056/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com