HomeAssistant with Ngnix proxy/ingress - cannot authenticate

I’m trying to run HomeAssistant behind a Ngnix ingress with TLS termination. I can get to the home page and can enter my login credentials, but I then get the lovelace “cannot connect” which tracks back to getting a 400 back from auth/token.

In the HA logs I see:
2025-05-08 18:22:47.990 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.3.1 (192.168.3.1). Requested URL: ‘/auth/token’. (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36)

Grateful for help please.

I found the answer to this thanks to some other threads which gave some clues. The snippet you need in your Kubernetes ingress is as follows:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.org/websocket-services: home-assistant

Hope this helps someone else in the future.