成都创新互联网站制作重庆分公司

nginx设置用户名和密码

yum  -y install nginx

nginx部分配置文件

创新新互联,凭借十年的成都做网站、成都网站制作、成都外贸网站建设经验,本着真心·诚心服务的企业理念服务于成都中小企业设计网站有上千案例。做网站建设,选创新互联

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
		auth_basic "elk";
		auth_basic_user_file /etc/nginx/htpasswd;
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
[root@l2tp html]#  htpasswd -cb /etc/nginx/htpasswd liuhx 123456
Adding password for user liuhx
[root@l2tp html]# cat /etc/nginx/htpasswd 
liuhx:$apr1$qoRxZ3ly$0PTCsKkfyujESjb8Twdj9/
[root@l2tp html]# echo  "test 加密"> /usr/share/nginx/html/index.html 
[root@l2tp html]#
nginx -t
nginx

nginx设置用户名和密码

nginx设置用户名和密码


当前题目:nginx设置用户名和密码
本文来源:http://cxhlcq.com/article/jcsjci.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部