I am currently facing an issue with serving assets for my SonarQube deployment on a Kubernetes cluster using the Nginx Ingress Controller. When accessing the SonarQube UI through the browser, the assets (CSS, JS files) are not loading properly, and I receive the following error in the browser console:
Refused to apply style from 'https://internal.domain.com/js/outDLYDOPRS.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Here’s a brief overview of my setup:
- SonarQube is deployed as a service named
sonarqube-sonarquberunning on port
9000in my Kubernetes cluster.
- I have set up an Nginx Ingress resource to route traffic to the
- The Ingress resource is configured with rules to route traffic for different paths (
/css) to the
# MY INGRESS FILE apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: sonarqube-ingress namespace: sonarqube annotations: nginx.ingress.kubernetes.io/rewrite-target: / nginx.ingress.kubernetes.io/add-base-url: "true" spec: ingressClassName: nginx rules: - host: internal.domain.com http: paths: - pathType: Prefix path: "/" backend: service: name: sonarqube-sonarqube port: number: 9000
Despite these configurations, the assets are not loading as expected. I have verified the service’s status, checked the Ingress Controller logs, and reviewed the Ingress resource status, but I couldn’t identify the issue.
- Helm Version v3.12.3
- Kubectl Version v1.27
- Sonarqube Helm Chat version sonarqube-8.0.2+754
- Sonarqube App Version 9.9.2
Could anyone provide guidance or suggestions on how to troubleshoot and resolve this asset loading issue? Any help or pointers would be greatly appreciated!
Thank you in advance for your assistance!