nginx基于用户认证

来源:互联网 发布:福建省应急管理网络 编辑:程序博客网 时间:2024/06/07 18:11

 server {        listen 80 default_server;        server_name www.b.org;        location / {        root html/b.org;        index index.html;        }        location /download {        root html/b.org;        autoindex on;        }        location /fin {        root html/b.org;        auth_basic "private";        auth_basic_user_file "/etc/.htpasswd";        }}



htpasswd命令是由apache安装时提供的,如果没有安装apache,则安装apache工具包:httpd-util即可。

原创粉丝点击