ngixn给页面添加用户名和密码

vim /ebsig/services/etc/nginx/nginx.conf

location / {
  root $root_path;
  auth_basic 'Restricted';
  auth_basic_user_file htpasswd;
  proxy_pass http://10.2.0.28:5000;
}

/usr/local/inonesoft/nginx/sbin/nginx -s reload

htpasswd -c  /ebsig/services/etc/nginx/htpasswd dockerhub    #创建用户名和密码,需要安装httpd-tools软件包

 

posted @ 2017-12-27 13:56  Mansoncui  阅读(173)  评论(0编辑  收藏  举报