nginx设置用户名和密码-创新互联

yum  -y install nginx

nginx部分配置文件

创新互联主营惠安网站建设的网络公司,主营网站建设方案,重庆App定制开发,惠安h5重庆小程序开发搭建,惠安网站营销推广欢迎惠安等地区企业咨询    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设置用户名和密码

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


分享名称:nginx设置用户名和密码-创新互联
文章位置:http://myzitong.com/article/cohhjs.html