Repository navigation
Description
Hi,
I hosted this unity catalog in Azure Kubernetes (AKS Cluster) and trying to hit unitycatalog-ui service through nginx, but I am getting error "Invalid Host header".
Same working fine if I browse Private IP of service on port 80.
Steps to reproduce the behavior:
-
Create Nginx LB
helm install ingress-nginx-unitycatalog ingress-nginx --repo https://kubernetes.github.io/ingress-nginx --version v4.8.3 --set controller.replicaCount=2 --set controller.ingressClassResource.name=ingress-nginx-unitycatalog --set controller.ingressClassResource.enabled=true --set controller.watchIngressWithoutClass=true --set controller.ingressClassByName=true --set controller.ingressClass=ingress-nginx-unitycatalog --set controller.ingressClassResource.controllerValue="k8s.io/ingress-nginx-unitycatalog" --set controller.service.annotations."service.beta.kubernetes.io/azure-load-balancer-health-probe-request-path"=/healthz --namespace unitycatalog --set controller.nodeSelector."kubernetes.io/os"=linux -
Host unitycatalog-UI also as service
apiVersion: v1
kind: Service
metadata:
name: unitycatalog-ui
labels:
app: unitycatalog
spec:
selector:
app: unitycatalog
component: ui
ports:- protocol: TCP
port: 80 # Exposes port 80 externally
targetPort: 3000 # Mapped to internal port of the UI container
type: LoadBalancer # This will expose the UI externally
- protocol: TCP
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
cert-manager.io/issuer: DigiCert SHA2 Secure Server CA
kubernetes.io/ingress.class: ingress-nginx-unitycatalog
nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
nginx.ingress.kubernetes.io/cors-allow-methods: '*'
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/proxy-body-size: "0"
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/server-alias: unitycatalogdev.com
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.org/client-max-body-size: "0"
name: ingress-nginx-unitycatalog
namespace: unitycatalog
spec:
rules:
- host: unitycatalogdev.com
http:
paths:- path: /
pathType: ImplementationSpecific
backend:
service:
name: unitycatalog-ui
port:
number: 80
tls:
- path: /
- hosts:
- unitycatalogdev.com
secretName: aks-latest-ingress-tls
- unitycatalogdev.com
- Browse the url unitycatalogdev.com you will get
Invalid Host header
Expected behavior
same behavior as http but now it should work with https also.
Activity
mblaauw commentedon Feb 6, 2025
Issue here seems to be that when you start the UI with yarn start or npm run start, it launches a dev server with websocket/hot reload functionality. This combines badly with a k8s ingress. Workaround is to yarn build it and the serve it via a more straight forward webserver.
Note: patching of utils/constants.ts is likely needed as you loose the proxy ref in the package.json which then leads to CORS issues which you can solve with the correct annotations on your ingress
hangnality commentedon Apr 28, 2025
I encountered the same error in my Docker Compose. Setting the environment variable
DANGEROUSLY_DISABLE_HOST_CHECK=trueresolved it.Reference: https://stackoverflow.com/questions/46794256/react-scripts-invalid-host-header
[Helm] Start the UI with bun and test the chart install in CI (#2019)
[Docs] Add a Helm deployment guide and the chart release steps (#2021)