-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
openapi_url incorrect from behind reverse proxy #15
Comments
Thanks for the report. I'll check it, I agree that this is probably the most straightforward way to solve it, with a "public path". This is also (probably) related to #8 I'll check it. |
Yup, sorry, I didn't notice #8. This is indeed a duplicate of that issue. Would you like me to close this one? |
This should be solved by PR #26 by @kabirkhan . It is released as Let me know if it works for you. |
Love it! I'll test it out asap! |
Great! Thanks for reporting back and closing the issue. |
For anyone coming across this, the new link for the tutorial is here: |
Even newer link 😄: https://fastapi.tiangolo.com/advanced/behind-a-proxy/ |
The use case:
I'm running FastAPI behind a nginx reverse proxy, at the path
http://localhost/api/
. The documentation front ends (swagger and redoc) are expectingopenapi.json
athttp://localhost/openapi.json
but it's actually routed athttp://localhost/api/openapi.json
.Setting
openapi_url
to/api/openapi.json
also changes theopenapi.json
path, so now it's looking for (through the proxy)http://localhost/api/api/openapi.json
.Ideally, it'd be great if we could specify the "public path" for the api. That's how e.g. vue does it
The text was updated successfully, but these errors were encountered: