Nginx – basic authentication with nginx – page loads before auth popup

http-basic-authenticationnginx

I have nginx and I have a directory that uses basic authentication. However, the page loads fully before the authentication popup comes. Even if I press cancel I'm not redirect to 401 authorization required page. Anyone know how I can fix this? is this a common issue?

Best Answer

Including the relevant snippet from your config and the specific URL that you are seeing this with might help. Without either of those I'm not sure anyone has enough information to be able to debug this issue.

At a guess I would assume that the URL you are loading isn't actually behind the auth directives and that some external resource is so that you see the page load but only get the auth dialog once the resource needs to be loaded.