Skip to content

Instantly share code, notes, and snippets.

@adriancbo
Created August 22, 2014 03:59
Show Gist options
  • Save adriancbo/d6b58f70d463e294fd46 to your computer and use it in GitHub Desktop.
Save adriancbo/d6b58f70d463e294fd46 to your computer and use it in GitHub Desktop.
In your sites-available -> sites-enabled folder respective website config file
server {
listen portnumber;
server_name ip_address;
location / {
root /var/www/mywebsite.com;
index index.html index.htm;
auth_basic "Restricted"; #For Basic Auth
auth_basic_user_file /etc/nginx/.htpasswd; #For Basic Auth
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment