<p>I'm using newest springdoc library to create one common endpoint with all Swagger configurations in one place. There're a bunch of microservices deployed in Kubernetes, so having documentation in one place would be convenient. The easiest way to do that is by using sth like this (<a href="https://springdoc.org/faq.html#how-can-i-define-groups-using-applicationyml" rel="nofollow noreferrer">https://springdoc.org/faq.html#how-can-i-define-groups-using-applicationyml</a>):</p>
<pre><code>springdoc:
  api-docs:
    enabled: true
  swagger-ui:
    disable-swagger-default-url: true
    urls:
      - name: one-service
        url: 'http://one.server/v3/api-docs'
      - name: second-service
        url: 'http://second.server/v3/api-docs'
</code></pre>
<p>and it works great, I can choose from list in upper right corner.
The problem is that it doesn't work through proxy. According to documentation I need to set some headers (<a href="https://springdoc.org/faq.html#how-can-i-deploy-springdoc-openapi-ui-behind-a-reverse-proxy" rel="nofollow noreferrer">https://springdoc.org/faq.html#how-can-i-deploy-springdoc-openapi-ui-behind-a-reverse-proxy</a>) and it works for single service called directly. But when i try grouping described above, headers are not passed to one-service or second-service, and they generates documentation pointing to localhost.</p>
<p>I suspect I need to use grouping (<a href="https://springdoc.org/faq.html#how-can-i-define-multiple-openapi-definitions-in-one-spring-boot-project" rel="nofollow noreferrer">https://springdoc.org/faq.html#how-can-i-define-multiple-openapi-definitions-in-one-spring-boot-project</a>) but I miss good example, how to achive similar effect (grouping documentation from different microservices). Examples shows only one external address, or grouping local endpoints. I hope, that using this approach, I'll be able to pass headers.</p>

<p>The properties <code>springdoc.swagger-ui.urls.*</code>, are suitable to configure external (/v3/api-docs url), for example if you want to agreagte all the endpoints of other services, inside one single application.</p>
<p>It will not inherit the proxy configuration, but it will use servers urls defined in your: servers <a href="http://one.server/v3/api-docs" rel="nofollow noreferrer">http://one.server/v3/api-docs</a> and <a href="http://second.server/v3/api-docs" rel="nofollow noreferrer">http://second.server/v3/api-docs</a>.</p>
<p>You want to have a proxy in front of your service, it's up to your service to handle the correct server urls you want to expose.</p>
<p>If you want it work out of the box, you can use a solution that handles proxying and routing like <a href="https://piotrminkowski.com/2020/02/20/microservices-api-documentation-with-springdoc-openapi/" rel="nofollow noreferrer">spring-cloud-gateway</a></p>
