Created
May 24, 2017 20:07
-
-
Save evemilano/d6286076cfd7d1810d219bc487c2143d to your computer and use it in GitHub Desktop.
Nginx Directory Password Protection - /etc/nginx/sites-enabled/default
This file contains 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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server ipv6only=on; | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
server_name localhost; | |
location / { | |
try_files $uri $uri/ =404; | |
auth_basic "Restricted Content"; | |
auth_basic_user_file /etc/nginx/.htpasswd; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Full article: https://www.evemilano.com/2017/05/impedire-accesso-google/