
server {
    listen       443 ssl http2;
    listen       [::]:443 ssl http2;
    server_name  thingsboard.windymuse.site;

    ssl_certificate /ssl/fullchain.crt;
    ssl_certificate_key /ssl/private.pem;

    ssl_session_timeout  10m;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;
    client_max_body_size 100m;
    
    location / {
        proxy_pass http://192.168.31.249:9191;
    } 
}

map $http_upgrade $connection_upgrade { 
	default upgrade; 
	'' close; 
}

upstream thingsboard-wsbackend { 
	server 192.168.31.249:9191;
	keepalive 1000;
}

server{
	listen 20038 ssl;
    server_name  thingsboard.windymuse.site;
    ssl_certificate /ssl/fullchain.crt;
    ssl_certificate_key /ssl/private.pem;
	ssl_session_timeout 20m;
	ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	ssl_prefer_server_ciphers on;
	ssl_verify_client off;
	location /{
	  proxy_http_version 1.1;
	  proxy_pass http://thingsboard-wsbackend;
	  proxy_redirect off; 
	  proxy_set_header Host $host; 
	  proxy_set_header X-Real-IP $remote_addr; 
	  proxy_read_timeout 3600s; 
	  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
	  proxy_set_header Upgrade $http_upgrade; 
	  proxy_set_header Connection $connection_upgrade; 
	}
}
