I have an ingress defined as follows;
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: webserver-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^(/master)$ $1/ redirect;
spec:
rules:
- host: my.test.domain
http:
paths:
- path: /master
backend:
serviceName: airflow-webserver-svc
servicePort: 80
The service airflow-webserver-svc
is pointing towards airflow webserver. the ingress now hits airflow webserver on GET /, but the site gets redirected from my.test.domain/master to my.test.domain/home which is the landing page of airflow webserver, but nginx returns 404 Page not found on that link :(. All works fine if I change the ingress path: /
, going to my.test.domain open up airflow webserver /home page, which then gets redirected to /login page. But I need to open the same webpage from my.test.domain/master. How can I do that ?
It doesn't redirect from path: "/master" to "/" inside the service. Is there any way to redirect from specified path in the ingress file to the root path of the service?
UPDATE:
Found out that airflow has its special configuration to do, when running behind proxy (here). I applied this solution but still no luck.