Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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.