Created
January 9, 2017 02:29
-
-
Save gdunstone/c307620ef1eec51b5c90e6c14bebf329 to your computer and use it in GitHub Desktop.
NGINX rule for public_html dir with basic auth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~* \~(.*)/(.*$) { | |
auth_basic "Restricted"; | |
auth_basic_user_file /home/$1/public_html/.htpasswd; | |
alias /home/$1/public_html/$2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment