我需要禁止网络访问apc.php文件。
试过几种方法,但不起作用。
location = /apc.php {
allow xx.xxx.xx.xxx;
allow xxx.xxx.xx.xxx;
deny all;
}请引导我..。
发布于 2014-07-29 12:43:58
使用此nginx配置
阻止对位于根文件夹apc.php 中的特定文件的所有访问。
location =/apc.php {
deny all;
return 404;
}示例:
http://example.com/apc.php将被拒绝或者只允许特定的ip地址访问apc.php。
阻止对根目录中的特定文件apc.php 的所有访问,但允许从ip XY进行访问。
location =/apc.php {
allow 192.168.178.1;
deny all;
}https://stackoverflow.com/questions/25015495
复制相似问题