'Change admin server url with @EnableAdminServer

I'm using @EnableAdminServer in SpringBoot application. Once it's enabled, my mapping for / is replaced by the admin server.

Then I tried to change the admin server to another port or another URL base:

spring.boot.admin.url=http://localhost:8081

But it's not applied somehow. What should I do?

EDIT

pom.xml

   <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.0.RELEASE</version>
        <relativePath/>
    </parent>

    ....

        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-server</artifactId>
            <version>2.1.4</version>
        </dependency>
    ....


Solution 1:[1]

That is not a valid configuration property anymore, it was previously a property you set in the client to tell it where to find the admin server and not a configuration property for the server itself. Check the current documentation for the right property names.

You set the port of Spring Boot including the admin server with:

server:
    port: 8080

Url base is determined by the DNS name of the host you deploy the application on so that will never be a configuration. There is however the property spring.boot.admin.ui.public-url but that is only used to fix links that might break behind a reverse proxy.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1