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

Reverse proxy configuration #7

Open
lucasoares opened this issue May 20, 2022 · 0 comments
Open

Reverse proxy configuration #7

lucasoares opened this issue May 20, 2022 · 0 comments

Comments

@lucasoares
Copy link

I'm using swag with fiber but I can't configure correctly the swagger definition to access the documentation behind a reverse proxy or multiple accesses.

In my use case I have three ways of accessing applications' documentation:

  1. From the proxy using a custom host and path. Example: https://my-proxy/custom/path/swag/index.html
  2. From the pod's direct IP. Example: http://123.123.1.2/swag/index.html
  3. From a port forwarding, which basically follows the same rule of 2.

The problem: I can't make basePath dynamic. It will always have one single value. And because of that the Try it out button may only work from one of those access.

Would be nice to have in swag's implementation a way of adding a prefix to the basePath in the swag.ReadDoc() call (or a new one).

If this is implemented I will be able to change the implementation of gofiber's swagger to use the X-Forwarded-Prefix header as prefix for the basePath using swag.

Thanks.

Openning by requested in swaggo/swag#1210

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

No branches or pull requests

1 participant