Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bremersee opened this issue Feb 16, 2020 · 2 comments
Closed

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

bremersee opened this issue Feb 16, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@bremersee
Copy link

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.

@bnasslahsen
Copy link
Collaborator

Hi @bremersee,

The issue you are describing is confirmed and will be fixed on v1.2.31.

@bnasslahsen bnasslahsen added the enhancement New feature or request label Jan 10, 2022
@halkosajtarevic
Copy link

hi @bnasslahsen,
could it be that the same is happening for webmvc? at least in my local tests it seemed like that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants