【问题标题】:Make Spring boot admin use a specific client URL让 Spring Boot 管理员使用特定的客户端 URL
【发布时间】:2019-10-17 18:12:15
【问题描述】:

我正在尝试将 Spring Boot Admin 与 Spring Boot Jax-RS/Swagger 应用程序集成,但遇到以下问题:

当客户端向管理服务器注册时,管理 UI 会显示一个类似于以下内容的 URL:http://my.domain:8001 作为访问应用程序的链接。不幸的是,这个应用程序没有 UI,它访问 Rest 服务的实际 URL 是 http://my.domain:8001/api/...

我真正想做的是让管理页面上的 URL 引用我为此服务的 Swagger UI。所以管理页面上的 URL 最好是http://my.domain:8001/swagger-ui.html。

我查看了可以在 application.properties 上设置的客户端属性,但似乎找不到可以满足我要求的属性。这可能与 Spring Boot Admin 一起使用吗?我是否需要进行某种自定义配置,或者我可以通过设置属性来做到这一点?

【问题讨论】:

    标签: spring-boot-admin


    【解决方案1】:

    如所列 here 和 here。您可以尝试在属性中设置:

    # Considering /admin is the mapping you want
    
    # For Admin boot client
    spring.boot.admin.client.url=http://localhost:8001/admin
    
    # For Admin boot server
    spring.boot.admin.context-path=admin
    

    【讨论】:

    • 这里OP的第二个问题的具体答案,关于将home url设置为swagger-ui.html端点,是设置spring.boot.admin.client.instance.service-url属性适当地,或...服务路径
    猜你喜欢
    • 2020-11-13
    • 1970-01-01
    • 1970-01-01
    • 2018-06-15
    • 1970-01-01
    • 2021-05-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多