server { listen 80; gzip on; gzip_min_length 0; root /usr/share/nginx/www; index index.html index.htm; server_name static.example.com; location / { try_files $uri $uri/ /index.html; } location = /auth { auth_basic "Restricted"; auth_basic_user_file /etc/nginx/.htpasswd; } } server { listen 80; root /usr/share/nginx/www; index index.html index.htm; server_name app.example.com; location / { proxy_pass http://<%= node['addresses']['app'] %>; } } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # root html; # index index.html index.htm; # # location / { # try_files $uri $uri/ /index.html; # } #} # HTTPS server # #server { # listen 443; # server_name localhost; # # root html; # index index.html index.htm; # # ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # # ssl_session_timeout 5m; # # ssl_protocols SSLv3 TLSv1; # ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP; # ssl_prefer_server_ciphers on; # # location / { # try_files $uri $uri/ /index.html; # } #}