From 0c9f5b58e031c48a7e3fd09b4b6ba8657427db12 Mon Sep 17 00:00:00 2001 From: Alexis Bruneteau Date: Wed, 22 Oct 2025 23:27:30 +0200 Subject: [PATCH] fix: Correct Ingress routing configuration for API and frontend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Reorder paths: /api must come before / (more specific first) - Add path regex pattern /api(/|$)(.*) to match API requests - Add rewrite-target annotation to strip /api prefix from backend requests - Enable regex matching with use-regex: "true" - Change API pathType to ImplementationSpecific for proper regex support This fixes the 404 errors by ensuring: 1. /api/* requests are correctly routed to the API service 2. The /api prefix is stripped before reaching the Express backend 3. Frontend /* requests fall through to the React SPA 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- dashboard-sqdc/k8s/ingress.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/dashboard-sqdc/k8s/ingress.yaml b/dashboard-sqdc/k8s/ingress.yaml index 90c998f..f0a8158 100644 --- a/dashboard-sqdc/k8s/ingress.yaml +++ b/dashboard-sqdc/k8s/ingress.yaml @@ -5,12 +5,21 @@ metadata: namespace: sqdc-dashboard annotations: nginx.ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/rewrite-target: /$2 + nginx.ingress.kubernetes.io/use-regex: "true" spec: ingressClassName: nginx rules: - host: diwii.sortifal.dev http: paths: + - path: /api(/|$)(.*) + pathType: ImplementationSpecific + backend: + service: + name: sqdc-api + port: + number: 3001 - path: / pathType: Prefix backend: @@ -18,10 +27,3 @@ spec: name: sqdc-frontend port: number: 80 - - path: /api/ - pathType: Prefix - backend: - service: - name: sqdc-api - port: - number: 3001