Routing issue with geoserver which is hosted in the specified path in Azure kubernetes using Nginx Ingress

8/28/2019

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.

Ingress.yaml


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

Expected Result:

Login Url: https://dns.sample.com/geoserver/web

Dashborad Url (After Login): https://dns.sample.com/geoserver/web/?1

Actual Result:

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.?

-- Seenu
azure-aks
kubernetes
nginx

0 Answers