title: Nginx ingress controller websocket support
body: <p>Recently I've been working on a toy app using Kubernetes. Part of the app is a web server that needs to support WebSockets. Currently, I'm using port-forwarding to access the web server and everything works just fine.</p>
  
  <p>I'd like to switch to using an Ingress and IngressController to avoid using the port forwarding.</p>
  
  <p>Here is my <code>Ingress</code> config:</p>
  
  <pre><code>apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    name: app-ingress
    annotations:
      nginx.ingress.kubernetes.io/rewrite-target: /
      nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
      nginx.ingress.kubernetes.io/secure-backends: "true"
      nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
      nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
  spec:
    rules:
    - http:
        paths:
        - path: /app
          backend:
            serviceName: web-svc
            servicePort: 3030
        - path: /ws
          backend:
            serviceName: web-svc
            servicePort: 3030
  </code></pre>
  
  <p>Now accessing the app through <code>$(minikube ip)/app</code> works just fine, but the WebSocket requests all fail because nginx is returning a 200 and not a 101. </p>
  
  <p>I've tried adding the <code>nginx.org/websocket-services</code> annotation but that doesn't seem to be working either.</p>
  
  <p>Has anyone encountered a similar situation?</p>
  
  <p>Cheers</p>