node-red lost connection


I got this problem when i make virtual host in nginx with node-red, node-red give me some error lost-connection to server , and the problem is web socket not forwarded in nginx, and the solution is here

Add some line of code like below

server {
    listen 443 ssl;
    server_name domainname.com www.domainname.com;
    ssl on;

    ssl_certificate     /etc/ssl/public.crt.pem;
    ssl_certificate_key /etc/ssl/private.key.pem;

    location / {
        proxy_pass https://domainname:1880;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

Restart your nginx and it works

Happy Coding …

Salam ngoprek …

Advertisement