Open sspsinha opened 4 years ago
/WebSocket connection to 'ws://localhost:9097/graphql' failed: Error during WebSocket handshake: Unexpected response code: 405
/Issue while hosting the graphql server on nginx
/Nginx.config websocket server setting
listen 9097;
server_name localhost;
location /subscription{
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://localhost:3007;
}
My graphql server is running locally on localhost:3007/graphql. But with above configuration socket is not getting created.
Getting below error:
WebSocket connection to 'ws://localhost:9097/graphql' failed: Error during WebSocket handshake: Unexpected response code: 405.
same issue here, getting this error from frontend, client.ts:557 WebSocket connection to 'ws://localhost:8080/graphql' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
here is my setup,
server { location / { proxy_pass http://web:8080; } }
Any solution for this @sannge @sspsinha ?
@bahachammakhi any solution?)
I have this configuration for nginx
And this one in nestjs
And the postman returns 400 when I'm trying to connect
For browser the same
So, I've found the solution, the problem was in postman, I don't know why, but websockets there is working inappropriate, btw, some problem was with nginx, I had two of them, on inside the docker container and the second main on the server, and I need to add the same thing (proxy_set_header etc.) to both of nginxs.