1

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?

Stephen K
  • 162
  • 8

2 Answers2

1

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.

Etan Reisner
  • 1,373
  • 6
  • 15
0

I had a similar issue. Normally it means that the main site hits a location block in your nginx config BEFORE the location block with the auth settings. You'll see the auth settings only for some kind of css or so that is loaded and hits the correct location block.

Check the network tab in chrome (or whatever browser) to see which file is answering with 401 and investigate from there.

shredding
  • 123
  • 9