I'm attempting to set up an Nginx Ingress on my local Minikube, but am having problems with the paths actually matching. I have two services set up, that I want to each serve different paths at the same domain. One is a Django-based API backend, the other is a Node-based frontend. My Ingress configuration is as follows:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test
spec:
rules:
- host: test.local
http:
paths:
- path: /
backend:
serviceName: frontend
servicePort: 3000
- path: /api
backend:
serviceName: backend
servicePort: 8000
- path: /admin
backend:
serviceName: backend
servicePort: 8000
- path: /static
backend:
serviceName: backend
servicePort: 8000
If I navigate to http://test.local/
in my browser, the Node frontend successfully serves that route. If I navigate to http://test.local/admin/
, the Django backend successfully serves that route, and corrects redirects to http://pingpong.local/admin/login/?next=/admin/
since I am not logged in (which is also served correctly from the Django backend). However, none of the CSS loads, because http://test.local/static/
is being served by the Node frontend for some reason. Everything under the /api
route also gets served by the Node frontend.
None of the documentation, examples, or other resources that I've been able to find seem to indicate that I'm doing anything incorrectly here, so I'm at a bit of a loss to figure out why it's sort of working.
Well, I'm still not sure exactly what the problem was, but after a restart of my computer, the Ingress is now working as I'd expect it to… Current best guess is some sort of caching happening somewhere.