2

My question is similar to Password protect a specific URL except I'm trying to achieve this in Nginx instead of Apache.

Please suggest way to do it. It's a url with dynamic content, not a file.

Community
  • 1
  • 1
Chirag
  • 1,189
  • 2
  • 21
  • 43

1 Answers1

0

This should work. Look at module to find out passwd file format. Basically Apache's one will be good.

location /protected/path {
    auth_basic           "closed site";
    auth_basic_user_file conf/htpasswd;
}
Alexey Ten
  • 13,794
  • 6
  • 44
  • 54