Skip to content
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

Openapi Server Object url supports reverse proxy #752

Closed
oursy opened this issue Jun 29, 2020 · 1 comment
Closed

Openapi Server Object url supports reverse proxy #752

oursy opened this issue Jun 29, 2020 · 1 comment

Comments

@oursy
Copy link

oursy commented Jun 29, 2020

There is a webflux-functional endpoint A service. Proxy via Spring Cloud Gateway.
A service is behind the gateway, so use the following solution
https://springdoc.org/faq.html#how-can-i-deploy-springdoc-openapi-ui-behind-a-reverse-proxy

After setting the forward-headers-strategy: framework property
The webflux-functional endpoint request starts at 404.
Specific information can be viewed spring-projects/spring-framework#25270

oursy pushed a commit to oursy/springdoc-openapi that referenced this issue Jun 29, 2020
@bnasslahsen
Copy link
Contributor

@oursy,

The settings are for reverse proxies: apache/nginx or others ...
For spring-cloud-gateway, you don't need to set server.forward-headers-strategy=framework.

Basically, all what you need:

  • Declare springdoc-openapi-webflux-ui, on the spring-cloud-gateway side
  • Declare springdoc-openapi-webflux-core, on your back-end services that using spring-webflux (account-service).

You can have access,
1)- By just updating, your application.yml on the gateway side:

springdoc:
  swagger-ui:
    urls[0]:
      name: account
      url: /account/v3/api-docs/

2)- Or programatically: This is the sample demo code for the integration with spring-cloud-gateway:

You can find attached, the working sample as well;
forward-proxy-demo-v1.zip

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

Successfully merging a pull request may close this issue.

2 participants