Nginx basic_auth
You need to accept connections for /
and /index.html
without authentication.
index index.html;location = / { }location = /index.html { }location / { auth_basic "Private zone"; auth_basic_user_file /user/.httpasswds;}
See this document for details.