2016-08-29 6 views
2

は私が設定を持っている: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は、基本的な認証ダイアログなしで完璧に動作し、

インデックスファイルはindex.htmlを、 しかしwww.myserver.orgまたはwww.myserver.org/パスワードを要求されます。

どうすれば解決できますか?ありがとうございました。

答えて

3

認証なしで//index.htmlの接続を受け入れる必要があります。

index index.html; 

location =/{ } 

location = /index.html { } 

location/{ 
    auth_basic "Private zone"; 
    auth_basic_user_file /user/.httpasswds; 
} 

this documentを参照してください。

+0

ありがとうございます。 – Flintyk