Score:0

Websockets failing without error message

do flag

I have a NginX server running two nodeJs applications, Let's call them A and B.

Both applications are working correctly for websockets on my local machine, and https calls are working on the server for both applications, but websockets are only working for the application in the root location "/".

Below is my Nginx Config

        location /applicationB/ {
             proxy_pass http://localhost:8001;
             proxy_http_version 1.1;
             proxy_set_header Upgrade $http_upgrade;
             proxy_set_header Connection 'upgrade';
             proxy_set_header Host $host;
             proxy_cache_bypass $http_upgrade;

             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             set_real_ip_from 127.0.0.1;
             real_ip_header X-Forwarded-For;
             real_ip_recursive on;
        }

        location / {
             proxy_pass http://localhost:8000;
             proxy_http_version 1.1;
             proxy_set_header Upgrade $http_upgrade;
             proxy_set_header Connection 'upgrade';
             proxy_set_header host $http_host;
             proxy_cache_bypass $http_upgrade;
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             set_real_ip_from 127.0.0.1;
             real_ip_header X-Forwarded-For;
             real_ip_recursive on;
        }

I believe this must be a configuration issue rather than an issue with the application because if I update both locations to point to the same application the websockets will succeed for the root location but still fail for the "applicationB" location.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.