您的位置:首页 > 其它

访问控制

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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  访问控制