From 43cd36d98bd7d1cd9582fec78bd972ea810942db Mon Sep 17 00:00:00 2001 From: ictmaatwerk Date: Thu, 25 Oct 2018 14:32:36 +0200 Subject: [PATCH] Add 'Nignx_passwordDir.sh' --- Nignx_passwordDir.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Nignx_passwordDir.sh diff --git a/Nignx_passwordDir.sh b/Nignx_passwordDir.sh new file mode 100644 index 0000000..41fa9c4 --- /dev/null +++ b/Nignx_passwordDir.sh @@ -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 +#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 \ No newline at end of file