I have a service running on Kubernetes available on a domain like example.com
. I'm trying to add a path which should redirect to a wordpress blog. So I need to add a rule: everithing that goes in /blog/ should redirect to wordpress, otherwise use the main app.
I tried to include a regexp for the main application path to include all except /blog/
- host: example.com
http:
paths:
- path: /^(?!blog).*$
but I keep getting must be a valid regex
or if I remove the slash, it says must be an absolute path
. I can't seem to find a way how to do that, it just keeps redirecting to my root app
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: app
annotations:
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: example.com
http:
paths:
- path: /
backend:
serviceName: MainAppService
servicePort: 3010
- path: /blog/*
backend:
serviceName: BlogService
servicePort: 3020