Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dodyagung/f29243adc656568f0360 to your computer and use it in GitHub Desktop.
Save dodyagung/f29243adc656568f0360 to your computer and use it in GitHub Desktop.
Create htpasswd file for nginx (without apache)
If you're like me, and use Nginx instead of Apache, you could eventually face this problem: Create an htpasswd file (for htaccess "authentication").
To create your file, without installing Apache, just run:
$ printf "USER:$(openssl passwd -crypt PASSWORD)\n" >> .htpasswd
Replace USER and PASSWORD for your user and password :)
source : https://coderwall.com/p/zvvgna
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment