nginx認證怎么實現

安裝httpd

yum install

使用htpasswd生產密碼文件

htpasswd -c /usr/local/nginx/conf/htpasswd aming # -c 表示創建文件, aming是用戶名 # 當添加用戶時,需要去掉 -c 參數 # 修改密碼的方式和添加用戶的方式相同

配置nginx用戶認證

location  /admin/   {       auth_basic              "Auth";       auth_basic_user_file   /usr/local/nginx/conf/htpasswd;   }

? 版權聲明
THE END
喜歡就支持一下吧
點贊14 分享