0

I am trying to deploy octoprint on k8s cluster running ingress-nginx with letsencrypt.

Ingress annotations are set up as following:

nginx.ingress.kubernetes.io/configuration-snippet: |
      proxy_set_header Host $http_host;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Scheme $scheme;
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/enable-modsecurity: "true"
nginx.ingress.kubernetes.io/enable-owasp-core-rules: "true"
nginx.ingress.kubernetes.io/proxy-body-size: "0"
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
nginx.ingress.kubernetes.io/ssl-redirect: "true"

It works great with above configuration but when basic authentication is added, websocket seems to be not working as shown below:

nginx.ingress.kubernetes.io/auth-realm: Authentication Required - ok
nginx.ingress.kubernetes.io/auth-secret: basic-auth
nginx.ingress.kubernetes.io/auth-type: basic

enter image description here

Does websocket not support basic auth headers?

Steve
  • 863
  • 3
  • 9
  • 21
  • does this help https://stackoverflow.com/a/57193064/2777988 – Rakesh Gupta Aug 14 '21 at 22:28
  • @Steve, did you try to use nginx.ingress.kubernetes.io/auth-realm: "Authentication Required - ok" with quotes, as described in [user guide](https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#authentication)? – Andrew Skorkin Aug 16 '21 at 17:27
  • @Andrew Skorkin, yes that is set with double quotes. Authentication works as i tended. Websocket connection is the piece that is struggling. – Steve Aug 17 '21 at 23:05
  • Hello @Steve Did you solve your issue? If not, could you please add log file for octoprint? – Andrew Skorkin Sep 01 '21 at 12:20

0 Answers0