![](/img/trans.png)
[英]nginx: restrict access to everything with basic_auth except for a specific page
[英]Nginx basic_auth
我有設置:
location / {auth_basic "Private zone";auth_basic_user_file /user/.httpasswds;}
和
location index.html {auth_basic off;}
www.myserver.org/index.html
無需基本的身份驗證對話框www.myserver.org/index.html
完美運行,
索引文件是index.html,但是www.myserver.org
或www.myserver.org/
要求輸入密碼。
怎么解決呢? 謝謝。
您需要接受/
和/index.html
連接而無需身份驗證。
index index.html;
location = / { }
location = /index.html { }
location / {
auth_basic "Private zone";
auth_basic_user_file /user/.httpasswds;
}
有關詳細信息,請參見此文檔 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.