Nginx Config Help - Cant password protect

Hi,

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?

James

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?

-Tim

Reply

Please enter an answer
Tips:

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] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct