0

I have deployed the oscarfonts/geoserver container in a kubernetes cluster behind an NGINX ingress controller. The ingress controller is set up to route /geoserver to this service while rewriting the URL to strip the geoserver prefix. The only issue with this is that any URLs coming from geoserver do not include the /geoserver prefix (as the ingress controller doesn't 'put it back in'), e.g. /geoserver/geoserver/ will redirect to /geoserver, but /geoserver/geoserver/index.html works fine.

# Source: geoserver/templates/ingress.yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: RELEASE-NAME-geoserver
  labels:
    helm.sh/chart: geoserver-0.1.0
    app.kubernetes.io/name: geoserver
    app.kubernetes.io/instance: RELEASE-NAME
    app.kubernetes.io/version: "1.16.0"
    app.kubernetes.io/managed-by: Helm
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/proxy-body-size: 75M
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
  tls:
    - hosts:
        - "myhost"
      secretName: aks-ingress-tls
  rules:
    - host: "myhost"
      http:
        paths:
          - path: /geoserver(/|$)(.*)
            backend:
              serviceName: RELEASE-NAME-geoserver
              servicePort: 31006

Thanks

Stuart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.