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 } }