Skip to content

Doploy behind a reverse proxy #153

@hectoryo

Description

@hectoryo

I'm moving from springfox to springdoc and I'm finding the following problem.

In the doc, you specify that the deploy urls are as follows:

http://server:port/context-path/swagger-ui.html
http://server:port/context-path/v3/api-docs 

In my case, the Spring Project is behind a reverse proxy, and I don't have access to the base url of the server, so my urls look something like:

http://server:port/custom-path/context-path/swagger-ui.html
http://server:port/custom-path/context-path/v3/api-docs 

The problem is when I attempt to enter to the swagger-ui.html I see this error:
image
The point is, the web page is attempting to reach http://server:port/context-path/v3/api-docs instead of http://server:port/custom-path/context-path/v3/api-docs

As a last thing to mention, if I try to load http://server:port/custom-path/context-path/swagger-ui/index.html?url=/custom-path/context-path/v3/api-docs&validatorUrl= the page loads as expected

Is there a way to customize the path it loads by default? or maybe make it able to know the path where you are?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions