Spring boot admin Kubernetes Ingress Spring boot admin Kubernetes Ingress kubernetes kubernetes

Spring boot admin Kubernetes Ingress


The problem is that your spring boot admin interface has no way to know that you're using "/admin" suburl.

nginx.ingress.kubernetes.io/rewrite-target: /$1 ask nginx to rewrite your url matching the second group.So when you're hitting: https://XXXXX/admin/ui nginx rewrite your url to https://XXXXXX/ui and then send it to spring boot.

I don't know well spring boot but you should have a way to provide him a suburl so instead of serving to /ui it server to /$BASE_URL/ui.

Then weather how it works you might need to change how nginx rewrite the url by something like:

  • path: ^(/admin/)(.+)\
  • nginx.ingress.kubernetes.io/rewrite-target: $1/$2


Finally I found the solution.

Spring boot admin has a tool for that called "public URL"

      spring:        application:          name: administrator-interface        boot:          admin:            context-path: "/ui"            ui:              public-url: "https://XXX/admin/ui"      server:        use-forward-headers: true

whith such configuration I am telling spring boot admin that i want to connect with a context /ui but when trying to load resources it should make the request to /admin/ui.

Now i can connect with the interface trought https:/XXX/ui and is sending request to load resources from https://XXX/admin/ui adding the prefix set by ingress

Thank you @NoƩ