Skip to content

Reverse proxy configuration is not behaving correctly (webflux) #435

Closed
@bremersee

Description

@bremersee

Preconditions:

  • The application is running with no context path (If you run the application locally, you'll be able to access the swagger-ui under http://localhost:8080/swagger-ui.html etc.).
  • The reverse proxy path is for example /appname.
  • X-Forwarded-Prefixis set to /appname.
  • server.forward-headers-strategy=framework is set.
  • springdoc.api-docs.path=/v3/api-docs (default)

Description:
Then I can get the api-docs under http://<server>:<port>/appname/v3/api-docs. That's ok.
But the config url http://<server>:<port>/appname/v3/api-docs/swagger-config returns status 404.

If I use a configuration like that

springdoc:
  api-docs:
    path: "/appname/v3/api-docs"
  webjars:
    prefix: "/appname/webjars"
  swagger-ui:
    path: "/appname/swagger-ui.html"
    oauth2-redirect-url: "/appname/swagger-ui/oauth2-redirect.html"

I can access the swagger-config with http://<server>:<port>/appname/v3/api-docs/swagger-config.
But then http://<server>:<port>/appname/v3/api-docs returns 404.
The api-docs are then accessible under http://<server>:<port>/appname/appname/v3/api-docs.

Expected behavior
http://<server>:<port>/appname/v3/api-docs and http://<server>:<port>/appname/v3/api-docs/swagger-config work with the default property springdoc.api-docs.path=/v3/api-docs.

To Reproduce
Steps to reproduce the behavior:

  • Spring Boot 2.2.4.RELEASE
  • spring-webflux 5.2.3.RELEASE
  • springdoc-openapi 1.2.30

Spring webmvc I haven't tested yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions