nginx设置访问密码

2019-09-11

通过htpasswd命令创建密码文件。

yum install httpd-tools
htpasswd -bc conf/htpasswd.users test 123456

创建htpasswd.users,配置Nginx
htpasswd.users
user01:adfjalsjdfsd

vi /usr/local/nginx/conf/nginx.conf
server {
listen 8088;
root /data/deploy/www;
index index.php index.html index.cgi;
location /nagios{
auth_basic " online chat system";
auth_basic_user_file /usr/local/nagios/etc/htpasswd.users;

分类:Linux | 标签: |

相关日志

评论被关闭!