- 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 <noreply@anthropic.com>
30 lines
709 B
YAML
30 lines
709 B
YAML
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: sqdc-dashboard-ingress
|
|
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:
|
|
service:
|
|
name: sqdc-frontend
|
|
port:
|
|
number: 80
|