events { worker_connections 4096; ## Default: 1024 use epoll; } http { include mime.types; default_type application/octet-stream; server { sendfile on; keepalive_timeout 65; listen 80; listen [::]:80; root /var/www/vb-net.com/forum; index Index.htm; server_name forum.vb-net.com; location / { try_files '' /Index.htm =404; } } server { sendfile on; keepalive_timeout 65; listen 80; listen [::]:80; root /var/www/vb-net.com/html; index Index.htm index.htm index.html Index.html; server_name vb-net.com www.vb-net.com; location / { try_files $uri $uri/ $uri/Index.htm =404; } location /2015/Doc/ { try_files $uri $uri/ =404; auth_basic "Restricted Content"; auth_basic_user_file /2015/Doc/.htpasswd; } location /AndroidBook/Doc/ { try_files $uri $uri/ =404; auth_basic "Restricted Content"; auth_basic_user_file /AndroidBook/Doc/.htpasswd; } location /ProgramTheory/Books/ { try_files $uri $uri/ =404; auth_basic "Restricted Content"; auth_basic_user_file /ProgramTheory/Books/.htpasswd; } location ~ /\. { deny all; access_log off; log_not_found off; } location ~ \.php$ { try_files $uri =404; } location ~ (.*)/index.htm$ { return 301 $1/Index.htm; } } } }