events {
    worker_connections 4096;
    multi_accept on;
}

http {
    keepalive_timeout 65;
    types_hash_max_size 2048;
    include mime.types;
    default_type application/octet-stream;
    
    server {
    listen 8100;
    server_name localhost;

    #location ~ /\.(?!well-known).* {
      # include  /etc/nginx/mime.types;
    #}
	
    location ~ \.css {
	add_header  Content-Type    text/css;
    }

    location ~ \.js {
        add_header  Content-Type    application/x-javascript;
    }

    #location / {
     #   try_files $uri $uri/ /index.html;
    #}

    location /ws/ {
	proxy_buffering on;
	proxy_buffer_size 1M;
	proxy_busy_buffers_size 1M;
	proxy_buffers 64 1M;
	proxy_connect_timeout       60000;
	proxy_send_timeout          60000;
	proxy_read_timeout          60000;
	send_timeout                60000;
	proxy_set_header X-Real-IP $remote_addr;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header X-NginX-Proxy true;
	proxy_pass http://127.0.0.1:3003;
	proxy_ssl_session_reuse off;
	proxy_set_header Host $http_host;
	proxy_cache_bypass $http_upgrade;
	proxy_redirect off;
	add_header 'Access-Control-Allow-Origin' '*';
	add_header 'Access-Control-Allow-Credentials' 'true';
	add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
	add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
    }

    #include  mime.types;
    #access_log off;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    index index.html;

    charset utf-8;

    root "/app/public";
    } 
}
