Description
Describe the bug
Hello,
Our users access swagger using direct access to api : http://localhost:8080/api/v0/swagger-ui/index.html
And other users access the swagger UI behind nginx proxy : http://localhost/api/v0/myservice/swagger-ui/index.html
The problem is the config url is calculated just the first time and used for both access.
The issue is well known and described here
To Reproduce
Steps to reproduce the behavior:
Call swagger ui using nginx proxy : http://localhost/api/v0/myservice/swagger-ui/index.html
Call swagger UI without the proxy : http://localhost:8080/api/v0/swagger-ui/index.html
In the second call we have error message : Failed to load remote configuration.
It's because it makes a call to http://localhost:8080/api/v0/myservice/v3/api-docs/swagger-config that is built the first time when calling the swagger via nginx.
- What version of spring-boot you are using?
2.6.6 - What modules and versions of springdoc-openapi are you using?
1.6.9 - What is the actual and the expected result using OpenAPI Description (yml or json)?
- Provide with a sample code (HelloController) or Test that reproduces the problem
Please find HelloController with nginxConfig
Expected behavior
Both URLS work without any impact:
URL without nginx : http://localhost:8080/api/v0/swagger-ui/index.html
URL with nginx : http://localhost/api/v0/myservice/swagger-ui/index.html
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Thank you for your help
Best Regards,