Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question
up vote 2 down vote accepted

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:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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