Skip to content

Instantly share code, notes, and snippets.

@iambibhas
Created January 29, 2013 09:06
Show Gist options
  • Save iambibhas/4662891 to your computer and use it in GitHub Desktop.
Save iambibhas/4662891 to your computer and use it in GitHub Desktop.
Basic HTTP Auth for Nginx
username:sayVb7E97UXnw
$ irb
irb(main):001:0> “mypassword”.crypt(“salt”)
=> “sayVb7E97UXnw”
server {
#server stuff here
location /
auth_basic "Restricted";
auth_basic_user_file /location/of/htpasswd;
# other location stuff here
}
}
@iambibhas
Copy link
Author

sudo service nginx reload after this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment