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

feat: add optional BASE_PATH to Docker config #1378

Merged
merged 2 commits into from
Apr 27, 2022

Conversation

draoncc
Copy link
Contributor

@draoncc draoncc commented Sep 8, 2020

While working with redoc I came accross the lack of a "base path" option in the provided Docker image.

My use case is that I have redoc running behind a reverse proxy routing via path matching. E.g. the reverse proxy receives a request to <host>/docs, strips the request URL of /docs and forwards it to redoc. The way index.tpl.html is constructed, it tries to load favicon.png from <host>/favicon.png. The workaround is to send requests to <host>/docs/ instead, where it'll be correctly loaded from <host>/docs/favicon.png, but this feels dirty.

Setting BASE_PATH to /docs/ will prepend favicon.png, making it load from <host>/docs/favicon.png no matter the original request.

A possible alternative to this could be allowing users to specify BUNDLE_URL or similar, which defaults to redoc.standalone.js. That way, users could set BUNDLE_URL to /docs/redoc.standalone.js and PAGE_FAVICON to /docs/favicon.png. Another possible alternative could be to modify the nginx config.

I'd be happy to make adjustments.

@tvestelind
Copy link

I have the same problem and this PR would solve it.

I think that the changes look good, but it's not up to me 😅

@RomanHotsiy RomanHotsiy added this to the v2.0 milestone Mar 24, 2022
@anastasiia-developer anastasiia-developer self-assigned this Apr 18, 2022
@draoncc draoncc requested a review from a team as a code owner April 19, 2022 10:03
@draoncc draoncc requested review from AlexVarchuk and zalesky and removed request for a team April 19, 2022 10:03
@anastasiia-developer anastasiia-developer removed their assignment Apr 19, 2022
@anastasiia-developer anastasiia-developer merged commit 90f71c0 into Redocly:master Apr 27, 2022
@AlexVarchuk
Copy link
Collaborator

We'll release the new version of docker next week.

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 this pull request may close these issues.

6 participants