View Single Post
  #3 (permalink)  
Old 03-09-2009, 07:09 PM
DanL@VPSLink DanL@VPSLink is offline
Administrator
 
Join Date: Dec 2007
Posts: 1,141
Default

The nginx location directive documentation suggests that regular expressions can be used - the following should be sufficient to protect the contents of directories:

Code:
# Password Protect important Directories
location ~ /(admincp/.*|modcp/.*|includes/.*|install/.*) {
auth_basic            "Restricted";
auth_basic_user_file   /home/username/.htpasswd/passwd;
}
Reply With Quote