Comments on Basic HTTP Authentication with Nginx
This tutorial shows how you can use basic HTTP authentication with Nginx to password-protect directories on your server or even a whole website. This is the Nginx equivalent to basic HTTP authentication on Apache with .htaccess/.htpasswd.
6 Comment(s)
Comments
What if i only want to grant access to one user of the two ?
Like apaches's 'require user username'
using nginx and htpasswd, i get the authorization dialogue, and it correctly accepts the login, and resets the dialogue when entering false details, but if I press cancel, it shows the index.html page anyway!?
i try on wordpress its not working.
work for auth but for login its not php file downlaoded
I get this in Ubuntu 16.* when I run a htpasswd.py command:
Traceback (most recent call last): File "/usr/local/bin/htpasswd.py", line 20, in <module> from trac.util import saltImportError: No module named trac.util
Thanks, this was helpful and worked like a charm!
Hey guys if I want password protect folders and subfolders and not the files inside the folders, for example, .jpg and .pngs how can this be accomplished?