Nginx Config Help - Cant password protect


Im new to this but I used shell to run this command:

****cd /etc/nginx

htpasswd -b htpass user temp****

Then in my config I have this:

****auth_basic "Restricted";

authbasicuser_file /etc/nginx/htpasswd;****

When I go to my site I see the login box but using the "user / temp" credentials dont work. Can someone explain what I am doing wrong please?


1 Reply

When running the htpasswd command you are calling the file "htpass", while in your Nginx configuration you're calling it "htpasswd". Is your Nginx configuration pointing to the right file?



Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct