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

Author: susiloharjo

Khoirunnas anfa'ahum linnas A Father, Husband and love to learn person Love my Family, Electronics, Photography, Robot, Dreaming, Programming

Ditunggu komennya ...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: