nginx代理后的spring boot swagger 2-未找到swagger资源

nginx代理后的spring boot swagger 2-未找到swagger资源,spring,swagger,springfox,Spring,Swagger,Springfox,我的pom: 我的招摇过市页面正在加载,但得到了警告 无法推断基本url。这在使用动态servlet时很常见 注册或API位于API网关后面时。基本url是 所有招摇过市的资源都在哪里的根源。例如,如果 该api可在 基本url为。请输入位置 手动: 当我检查网络请求时,我可以发现后端返回404未找到 /炫耀资源/配置/安全 /招摇过市的资源 /招摇过市资源/配置/ui 有什么提示吗?有什么解决办法吗?我也有同样的问题,有解决办法吗?我也有同样的问题。 <dependency>

我的pom:

我的招摇过市页面正在加载,但得到了警告

无法推断基本url。这在使用动态servlet时很常见 注册或API位于API网关后面时。基本url是 所有招摇过市的资源都在哪里的根源。例如,如果 该api可在 基本url为。请输入位置 手动:

当我检查网络请求时,我可以发现后端返回404未找到 /炫耀资源/配置/安全

/招摇过市的资源

/招摇过市资源/配置/ui


有什么提示吗?

有什么解决办法吗?我也有同样的问题,有解决办法吗?我也有同样的问题。
<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger2</artifactId>
    <version>2.9.2</version>
</dependency>
<dependency>
    <groupId>io.springfox</groupId>
    <artifactId>springfox-swagger-ui</artifactId>
    <version>2.9.2</version>
</dependency>
@Configuration
@EnableSwagger2
@EnableWebMvc
@Profile("stage")
public class SwaggerConfig {
    @Bean
    public Docket api() {
        HashSet<String> protocols = new HashSet<>();
        protocols.add("http");
        protocols.add("https");
        return new Docket(DocumentationType.SWAGGER_2)
                .protocols(protocols)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build()
                .pathMapping("/");
    }
    @Bean
    public WebMvcConfigurer webMvcConfigurer()
    {
        return new WebMvcConfigurer()
        {
            @Override
            public void addResourceHandlers( ResourceHandlerRegistry registry )
            {
                registry.addResourceHandler( "swagger-ui.html" ).addResourceLocations( "classpath:/META-INF/resources/" );
                registry.addResourceHandler( "/webjars/**" ).addResourceLocations( "classpath:/META-INF/resources/webjars/" );
            }
        };
    }
}
location ~ ^/(swagger|webjars|configuration|swagger-resources) {
  proxy_pass https://backend;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection 'upgrade';
  proxy_set_header Host $host;
  proxy_cache_bypass $http_upgrade;
}