Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

In my Nginx setup I would like to password protect some website, except when I access it from my ip at home. How do I set this up?

Also, except for getting access to my home pc, is this safe?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

After long searching I found it myself.

When satisfy_any is put on "Directive solves access with at least one successful checking, executed by modules HttpAccessModule or HttpAuthBasicModule"

  location / {
    satisfy any;
    allow  10.1.1.10;
    deny   all;
    auth_basic            "closed site";
    auth_basic_user_file  /data/www_data/htpasswd;
  }

(satisfy any is the new syntax, satisfy_any threw a warning. The documentation I can't find however)

share|improve this answer

Your Answer

 
discard

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.