events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    client_max_body_size 0;

    server {
    # ==========
    # HTTP server
        listen 80;
        listen [::]:80;
    # ==========

    # ==========
    # HTTPS server
        # listen 443 ssl;
        # listen [::]:443;
        # http2 on;

        # ssl_certificate /etc/ssl/certs/cert.crt;
        # ssl_certificate_key /etc/ssl/private/cert.key;
        # ssl_dhparam /etc/ssl/algs/dhparam.pem;
        # ssl_protocols TLSv1.3;
        # ssl_prefer_server_ciphers on;
        # ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384';
    # ==========

        location / {
          proxy_pass          http://vms-web;
          proxy_set_header    Host             $host;
          proxy_set_header    X-Real-IP        $remote_addr;

          expires -1;
          add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
        }


        location /api {
          proxy_pass          http://server:3000;
          proxy_set_header    Host             $host;
          proxy_set_header    X-Real-IP        $remote_addr;

	        proxy_connect_timeout 300;
          proxy_send_timeout 300;
          proxy_read_timeout 300;
        }

        location /api/socket.io {
          proxy_pass http://server:3000;
	        proxy_send_timeout 100;
	        proxy_read_timeout 100;

          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "Upgrade";

          proxy_set_header    Host             $host;
          proxy_set_header    X-Real-IP        $remote_addr;
        }

   }

}
