Nginx 禁止其他ip访问某目录只允许某ip访问
· 技术积累 · Nginx

在你需要的配置文件中加上此段:

location ^~ /admin/ {           #你禁止其他人访问的目录
allow 192.168.1.1;   #允许的ip,也可以是网段使用掩码方式
deny all;                   #拒绝所有

#转发php
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
include fastcgi_params;

}

针对多个目录文件列表控制显示的类型时间大小

location ~* /list/(001|002|003|004|005) {
    autoindex on;
    autoindex_localtime on;
    autoindex_exact_size off;
}

本文最后更新时间 2023-12-12
文章链接地址:
https://me.jinchuang.org/archives/30.html
本站文章除注明[转载|引用],均为本站原创内容,转载前请注明出处
Nginx 配置 Referer 防盗链
MAXMIND 免费的GeoLite2数据库分享
不允许空 Referer访问,可以使用反向代理解决
在Nginx中配置使用Geoip2模块

iptables 安全策略

Linux 脚本处理按列求和

我要留言