I have an nginx server. I'd like to have directories available online but only if a certain password is supplied. Would it be bad to do something like:

location /password=mysuperstrongpassword {
      root /mydir

Is there a better way of accomplishing this?

Along the same lines, can someone point me in the direction of how to write a script that creates a new password every week or so, rewrites this page, and emails me the new password? Thanks!


Your super-strong password is likely to be stored in plain-text logs, your analytics solution, etc.

nginx has a module to do the standard Apache-style HTTP basic authentication.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.