I am trying to host geoserver web application in the specified path instead of base path using Nginx Ingress. I am able to access login page of the geoserver but once it is logged in it is redirecting to base path instead of specified path because of that I am not able to access dashboard of geoserver.
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: geoserver-ingress
namespace: default
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/rewrite-target: /geoserver/$1
spec:
rules:
- http:
paths:
- path: /geoserver/?(.*)
backend:
serviceName: geoserver
servicePort: 80
Login Url: https://dns.sample.com/geoserver/web
Dashborad Url (After Login): https://dns.sample.com/geoserver/web/?1
Login Url: https://dns.sample.com/geoserver/web
Dashborad Url (After Login): https://dns.sample.com/
It is routing to base path(/) instead of specified path(/geoserver/web/?1). I don't know what is wrong with nginx ingress config.
Could you please help on this.?