-
Notifications
You must be signed in to change notification settings - Fork 26
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
Hosting swagger /docs/ under reverse proxy URL prefix results in schema not found #234
Comments
Hi @bduncanj, Thanks for opening this issue - I don't see why we shouldn't be able to set the host prefix to the |
Does the |
@ndortega sorry for the delay in getting back to you on this one, but thank you for the quick response! It sounds like you've found the cause and fixed this. From my memory the same happened on the |
@bduncanj, As part of a recent patch I only removed the window.origin part - so it very well could still be failing. If the latest version still isn't working, let me know and I'll reopen this issue and find a way to insert the external_url |
As the title suggests, hosting the Oxygen generated endpoint under a reverse proxy (say, under the URL prefix of
/api/
) results in an error (schema not found) when accessing the Swagger API/api/docs
on the server.The path
/api/schema/
is valid but the issue is that the/docs
page injects the schema usinglocation.origin
.Setting the
external_url
argument ofserve()
doesn't help - this is not passed into the function (swaggerhtml
inautodoc.jl
).Is there an existing method to support hosting the Oxygen endpoint under a reverse proxy with a URI prefix? If not, it seems we could use the
external_url
inswaggerhtml()
when building the path to include the schema.The text was updated successfully, but these errors were encountered: