请问,在nginx admin中,.htaccess如何只允许一个ip?
就像Apache中的这样。
order deny,allow
deny from all
allow from 111.222.333.444
但这只适用于Apache
我希望命令的工作在nginxadmin中。。
所以可以拥有IP,只需浏览文件夹和文件
注意:我在服务器上使用nginxadminhttp://www.nginxcp.com/installation-instruction/
请帮我这个
谢谢。
编辑nginx.conf:
server {
...
allow 111.222.333.444;
deny all;
...
}
PS:Nginx不支持.htaccess
如果你想限制指定的目录:
server {
...
location /users/111 {
allow 111.222.333.444;
deny all;
}
location /users/123 {
allow 222.333.444.111;
deny all;
}
...
}