Skip to content

Spring Boot Admin behind Zuul Proxy with strip prefix (use another adminContextPath for the UI base path) #810

@matzegebbe

Description

@matzegebbe

Hi! Maybe this helps some guys of you out and you understand what I mean :)

After the update to Spring Boot Admin 2 the UI did not work anymore. The UI is behind a Zuul proxy. And our old configuration says:

spring:
  boot:
    admin:
      context-path: /manage/appcon

I checked the new configuration and used the spring.boot.admin.context-path after I saw the base tag in the UI.

<head>
    <base th:href="@{${adminContextPath} + '/'}" href="/">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="format-detection" content="telephone=no,email=no">
    <meta name="theme-color" content="#42d3a5">
    <link rel="shortcut icon" href="assets/img/favicon.png" type="image/png">
    <link href="assets/css/sba-core.css" rel="stylesheet">
    <title>Spring Boot Admin - Login</title>
</head>

Unfortunately, this parameter also means that the endpoints of the service only can be reached under this context path (Like in AbstractInstancesProxyController). Since the URLs are truncated in our proxy, the calls do not work. I think the UI base path should be separate from service path. I fixed that issue for me be creating the ui bean like this. With that we are able to "configure" the base path for the ui


    @Value("${admin.path:/sdi/app/admin/appcon}")
    private String adminPath;

    @Bean
    public UiController homeUiController() {
        return new UiController(adminPath,
                "My Admin Server",
                brand);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions