title: Running Meteor app with Nginx SSL proxy on Kubernetes
body: <p>I have a Meteor app deployed using Kubernetes on Google Cloud, configured with Nginx acting as SSL termination. Everything working ok.</p>
  
  <p>However, it appears that if two different clients connect to two different SSL containers, updates don't show up on the respective apps for up to 10 seconds, which makes it seem that Websockets isn't working, but polling is taking effect. I have confirmed that all clients are connected with Websockets, but since updates do not propagate immediately, perhaps Nginx isn't configured to correctly talk with the Meteor app.</p>
  
  <p>Here's my SSL/Nginx service:</p>
  
  <p><code>apiVersion: v1
  kind: Service
  metadata:
    name: frontend-ssl
    labels:
      name: frontend-ssl
  spec:
    ports:
    - name: http
      port: 80
      targetPort: 80
    - name: https
      port: 443 
      targetPort: 443 
    selector:
      name: frontend-ssl
    type: LoadBalancer
    loadBalancerIP: 123.456.123.456
    sessionAffinity: ClientIP
  </code></p>
  
  <p>And here is the Meteor service:</p>
  
  <p><code>apiVersion: v1
  kind: Service
  metadata:
    name: frontend
    labels:
      name: frontend
  spec:
    ports:
    - port: 3000
      targetPort: 3000
    selector:
      name: flow-frontend
    type: LoadBalancer
    loadBalancerIP: 123.456.123.456
    sessionAffinity: ClientIP
  </code></p>
  
  <p>For SSL termination, I'm using the Kubernetes suggested SSL setup forked with Websockets additions <a href="https://github.com/markoshust/nginx-ssl-proxy" rel="nofollow noreferrer">https://github.com/markoshust/nginx-ssl-proxy</a></p>