# HTTP/HTTPS server
#
server {
        listen 80;
        server_name localhost;

        root html;
        index index.html index.htm;

#        ssl on;
#        ssl_certificate /usr/share/nginx/server.cert;
#        ssl_certificate_key /usr/share/nginx/server.key;

#        ssl_session_timeout 5m;
#        ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
#        ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
#        ssl_prefer_server_ciphers on;

        location / {
#          auth_basic            "Restricted";
#          auth_basic_user_file  /usr/share/nginx/htpasswd;

          # Proxy settings
          # disable buffering so that watch works
          proxy_buffering off;
          proxy_pass %(api_server_address)s;
          proxy_connect_timeout 159s;
          proxy_send_timeout   600s;
          proxy_read_timeout   600s;

          # Disable retry
          proxy_next_upstream off;

          # Support web sockets
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
        }
}
