Have problem with secured websocket connection. I have app running on https, where mutations and queries works, but cannot establish wss connection :/ When I run the react app on not secured connection (http) and use ws then all is ok. I am not sure what may cause this issue - maybe nginx proxy, maybe nestjs graphql config or maybe react apollo client. Shortly:
Have server with nginx with configured cert. The server proxy subdirectory of my domain to some app (runned in docker container and exposed on port 3000):
server { listen 443 ssl; server_name mydomain.com [...cert configs...] location /one/of/app/ { proxy_pass http://localhost:3000/ } } As I mentioned the website works with secured connection, but the wss connection failed. I do not do anything extra in server or client - all configuration all the same instead the uri (https, wss instead http, ws). On not secured connection, with ws:// websocket works. Any sugestions?
Full error:
WebSocket connection to 'wss://mydomain.com/one/of/app/graphql' failed: Error during WebSocket handshake: Unexpected response code: 400