Skip to content

Instantly share code, notes, and snippets.

@v-thomp4
Created September 24, 2014 02:15
Show Gist options
  • Save v-thomp4/a1a52482b29209919774 to your computer and use it in GitHub Desktop.
Save v-thomp4/a1a52482b29209919774 to your computer and use it in GitHub Desktop.
htpasswd nginx
sudo apt-get install apache2-utils
sudo htpasswd -c /etc/nginx/.htpasswd exampleuser
server {
location / {
auth_basic "Restricted"; #For Basic Auth
auth_basic_user_file /etc/nginx/.htpasswd; #For Basic Auth
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment