Nginx - Password Protect Directory Nginx - Password Protect Directory shell shell

Nginx - Password Protect Directory


I'm sure you'd have fixed this by now, but thought I'd add this for others:

The Nginx documentation is a little cryptic on this, but does mention the "Apache variant of the MD5-based password algorithm (apr1)" should be used to generate the password hash. So using the -apr1 flag instead of -1 will work:

printf "Jane:$(openssl passwd -apr1 V3RySEcRe7)\n" >> /etc/nginx/htpasswd