Sample NGINX config to support DDP/WebSockets on Kubernetes


our Meteor app is deployed successfully in a number of environments in Galaxy, AWS ECS and stand alone Kubernetes.

On Galaxy and AWS ECS we can use browsers and our React Native app which connects using DDP/Websockets via the React Native Meteor package

in one stand alone (on premise) implementation which includes Kubernetes, which we’ve configured NGINX with the directives (see below) to support websockets,

    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;

the browser (eg Chrome) connects successfully to the server and supports websockets, however when we try and open the DDP connections via React Native Meteor we get a 400/bad connection and can never make a connection to the Meteor server

Any ideas pls?

can you share your react-native code ?
How do you know it is a 400 error ?
Do you see any request in nginx logs ?
can you dump the network requests to verify if the connect request is emitted / received / answered ?

@lc3t35 thanks again… as per How to DDP.connect if no websockets? I think this seems to be a network type of issue… I am waiting for some debug info as we don’t have access to those environments ourselves.

We were running test in a dev/test environment… and the issue still exisits there. We ended up putting the NGINX settings into the production environment, as it’s not live and presto that worked… so had 2 frustrating days trying to resolve in the dev/test environment. I’ll update when I know more.