# Websocket comms error

**URL:** https://discourse.nodered.org/t/websocket-comms-error/38802
**Category:** General
**Created:** [8 January 2021 16:38 UTC](https://discourse.nodered.org/t/websocket-comms-error/38802 "2021-01-08T16:38:20Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ljpaff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ljpaff/32/35020_2.png) [@ljpaff](https://discourse.nodered.org/u/ljpaff)
#### Post date: [8 January 2021 16:38 UTC](https://discourse.nodered.org/t/websocket-comms-error/38802/1 "2021-01-08T16:38:21Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [8 January 2021 20:20 UTC](https://discourse.nodered.org/t/websocket-comms-error/38802/2 "2021-01-08T20:20:58Z")

</div>

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](https://www.nginx.com/blog/websocket-nginx/)

---

<div class="post-metadata">

### Author: ![ljpaff](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ljpaff/32/35020_2.png) [@ljpaff](https://discourse.nodered.org/u/ljpaff)
#### Post date: [8 January 2021 21:45 UTC](https://discourse.nodered.org/t/websocket-comms-error/38802/3 "2021-01-08T21:45:55Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [9 March 2021 21:46 UTC](https://discourse.nodered.org/t/websocket-comms-error/38802/4 "2021-03-09T21:46:06Z")

</div>

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