簡體   English   中英

Nginx basic_auth

[英]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.orgwww.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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM