Add 'Nignx_passwordDir.sh'
This commit is contained in:
16
Nignx_passwordDir.sh
Normal file
16
Nignx_passwordDir.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#Source https://www.digitalocean.com/community/tutorials/how-to-set-up-basic-http-authentication-with-nginx-on-ubuntu-14-04
|
||||
|
||||
##install
|
||||
#install apache2-utils
|
||||
apt-get install apache2-utils -y
|
||||
|
||||
#create authentaction file
|
||||
htpasswd -c /etc/nginx/.htpasswd <user>
|
||||
#You will be prompted for a password
|
||||
|
||||
##add this to nginx configuttion underneath the location
|
||||
auth_basic "Private Property";
|
||||
auth_basic_user_file /etc/nginx/.htpasswd;
|
||||
|
||||
## reload nginx
|
||||
service nginx reload
|
||||
Reference in New Issue
Block a user