Last active
March 2, 2021 09:51
-
-
Save saissemet/00b0a44237326bb50a1948dcc731d61a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## We'll be creating and protecting a new website folder named "private" with the user "saissemet". ## | |
sudo mkdir /var/www/html/private | |
sudo echo 'saissemet' >> /var/www/html/private/index.html | |
sudo nano /etc/nginx/sites-available/default | |
location /private/ { | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/.htpasswd1; | |
} | |
sudo htpasswd -c /etc/nginx/.htpasswd1 saissemet | |
sudo systemctl restart nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment