访问控制
2016-02-25 11:29
246 查看
可以对admin.php访问进行控制
location ~ .*admin\.php$ { allow 127.0.0.1; deny all; include fastcgi_params; fastcgi_pass unix:/tmp/www.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /data/www$fastcgi_script_name;}
也可以针对全局配置
server{ listen 80; server_name www.test1.com www.aaa1.com www.bbb1.com; if ($host != 'www.test1.com') { rewrite ^/(.*)$ http://www.test1.com/$1 permanent; } index index.html index.htm index.php; root /data/www; access_log /tmp/access.log 123123 * deny 1.1.1.1 * deny ip location ~ .*admin\.php$ { auth_basic "123123 auth"; auth_basic_user_file /usr/local/nginx/conf/.htpasswd; include fastcgi_params;
location ~ .*admin\.php$ { allow 127.0.0.1; deny all; include fastcgi_params; fastcgi_pass unix:/tmp/www.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /data/www$fastcgi_script_name;}
也可以针对全局配置
server{ listen 80; server_name www.test1.com www.aaa1.com www.bbb1.com; if ($host != 'www.test1.com') { rewrite ^/(.*)$ http://www.test1.com/$1 permanent; } index index.html index.htm index.php; root /data/www; access_log /tmp/access.log 123123 * deny 1.1.1.1 * deny ip location ~ .*admin\.php$ { auth_basic "123123 auth"; auth_basic_user_file /usr/local/nginx/conf/.htpasswd; include fastcgi_params;
相关文章推荐
- 剖析 rudy 访问控制
- C++编程中私有和保护以及公有的类成员访问控制
- Swift语言中的一些访问控制设置详解
- Swift中的访问控制和protected
- Bell-lapadula模型
- 访问控制安全机制及相关模型 (二)
- 对USB设备的访问进行日志审核
- Java 访问类型控制
- 011Java访问控制
- 类的设计与受保护的成员
- Swift - 访问控制(private,internal,public)
- Java Access Modifier(访问控制):public, protected, private, friendly(no modifier)
- Java中的访问控制
- C++类访问控制及继承
- Client访问控制和Cyrus sasl认证.doc
- 国密SKF接口函数介绍之二:访问控制函数
- Swift新特性 -- 访问控制(Access Control)
- C++学习之继承中的访问控制
- C++之 虚函数的访问控制 以及 编译器的绑定策略
- [Oracle] 数据库安全之 - 虚拟私有数据库 (VPD)