Nginx 访问控制
来源:互联网 发布:新型网络搜索引擎 编辑:程序博客网 时间:2024/05/21 06:51
Nginx access control
一 :Based on the users
1 yum install httpd # install httpd creat htpasswd command
2 htpasswd -c /usr/local/nginx/conf/htpasswd test # create key
Like this
htpasswd -c /usr/local/nginx/conf/htpasswd test
New password:
Re-type new password:
Adding password for user test
ok seccessed create user and key.
3 cd /usr/local/nginx/conf # configure
Add
location / {
auth_basic "Auth";
auth_basic_user_file /usr/local/nginx/conf/htpasswd; # the path to the authfile
proxy_pass http://test;
proxy_redirect default ;
}
4 /usr/local/nginxy/sbin/nginx restart # restart services
二 : Base on ip
1 vim /usr/locl/nginx/conf/nginx.conf # configure
location / {
deny 192.168.85.89;
allow all;
root html;
index index.html index.htm;
}
2 pkill nginx && restart nginx services
Well ,you can also through the loading files to realize.
for example
1 cd /usr/local/nginx/conf && vim denyip
deny 192.168.85.89; # Refused to an IP
deny 192.168.85.0; # Refuse to an IP section
2 vim nginx.conf # configure
location / {
include denyip; # include files
root html;
index index.html index.htm;
}
3 pkill nginx && restart nginx services
- Nginx 访问控制
- Nginx 访问控制配置
- Nginx控制ip访问频率
- nginx rtmp配置访问控制
- Nginx+Lua+Redis访问频率控制
- Nginx、Springmvc实现下载文件访问控制
- 通过 lua 进行 nginx redis 访问控制
- 通过 lua 进行 nginx redis 访问控制
- 通过 lua 进行 nginx redis 访问控制
- nginx中ngx_http_access_module做访问控制
- 通过 lua 进行 nginx redis 访问控制
- ElasticSearch Nginx形式的访问控制
- nginx配置访问控制、rewrite应用、nginx代理
- 使用nginx作图片服务器的访问权限控制
- nginx-虚拟主机,访问控制,防盗链,代理服务
- Nginx+lua+http_checkmodule+tcp_checkmodule+动态监测与访问控制 安装
- nginx添加访问控制htpasswd及status配置
- nginx的IP访问控制及用户认证
- cas入门文章
- I/O
- 1
- TDD Tip:方法内部New出来的对象如何Mock
- windows编程中画笔与画刷
- Nginx 访问控制
- 自卑一阵子
- 嵌入式Linux下基于FFmpeg的视频硬件编解码
- GeoServer+OpenLayers发布下载的Google卫星影像
- Axis-1.1 webService实现跨project传递参数入
- 一个游戏程序员的学习资料
- 在vs2010+MFC中动态添加菜单选项
- 计算出二进制数中有多少个1
- 第九周实验报告2