I think auth_basic off;
works for generally simple pages with no reference to any other things that could be linked to the page. So here's the trick:
Actually when you set auth_basic off;
for certain uri, you need to be sure there is no reference for any brother-uris!!! But what if it is?
Well, I found no better way then just to track it. By default you need to check /var/log/nginx/access.log
for all 401 (unauthorized) statuses once you did a request to the /desired-url
which you want to put under location
wit auth_basic off;
directive.
So what was interesting in access.log
? I noticed that once i trigger /desired-url I immediately got reference for /static/
files. What I did?
Simply created new location
directive for /static/
path and of course it includes auth_basic off;
directive.
Not only one static folder, there was also 401 status for /favicon
file and some other files and folders.
So for all of them I simply created new location
blocks with auth_basic off;
directive.
Be aware creating location
for new path may not resolve the issue as new path could be following after. So constantly track access.log
I know it looks like a raw/fast solution and definitely can be improved/optimized but so there was nothing on the web that helped me better so here I share my experience.