Websocket comms error

Hi all,

i have upgrade nodered and nginx reverse proxy and with my configuration that was working for redirecting traffic by nginx has stopped working.

I am getting this error in access.log:

08/Jan/2021:17:32:46 +0100] "GET /comms HTTP/1.1" 400 11 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"

My configuration is:

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name nodered.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth, fill in ldap details in ldap.conf
    #include /config/nginx/ldap.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /login;

        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_unifi nodered;
        proxy_pass http://$upstream_unifi:1880;

    }

    location ^~ /comms {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable the next two lines for ldap auth
        #auth_request /auth;
        #error_page 401 =200 /login;

        include /config/nginx/proxy.conf;
        resolver 127.0.0.11 valid=30s;
        set $upstream_unifi nodered;
        proxy_pass http://$upstream_unifi:1880;
        proxy_buffering off;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_ssl_verify off;
    }

}

What could be wrong?.

Thanks in advance

Unless there is something hidden in the included proxy.conf, you are missing some stuff that would allow websockets to work.

Using NGINX as a WebSocket Proxy

I have checked all backup config and it is the same in all files. I have although a unifi controller using websockets configured inside this nginx and it is working without any websocket error.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.