-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
set root-path to uvicorn #55
Comments
I struggled with this as well. Got it working in the end, albeit by setting Before upgrading it didn't work either using the current Extending from @tiangolo will the images be updated in the near future? |
@poppash Python 3.7.8 Run configuration: I think the error is in the path here is console log: |
Gunicorn 20.1.0 You can fix it with: In this case you can change the ROOT_PATH with environment variable. After that you can strip the ROOT_PATH within the proxy. Example: Remove the /auth/v1 from the endpoints. On the proxy you can strip it with:
After that it must work properly. I also struggled for hours by the way. Tried the class ConfigurableWorker(UvicornWorker) method and struggled hours with the Gunicorn config but nothing worked. The solution above worked perfectly. |
For anybody coming here from the new ngrix-proxy version where the |
@0anton I came across this ticket while researching how to do this in here's an excerpt from our
I am in the process of documenting this property if it's of interest to anybody. |
@devraj Thank you so much! For people using server {
listen 80;
server_name example.com;
location / {
# For my react frontend served by an nginx container
proxy_pass http://localhost:7000;
}
location /api/{
# For FastAPI app running in docker container, where the endpoint should be /api/
# notice the trailing slash at the end, it is important,so that it performs stripping properly.
proxy_pass http://localhost:8100/;
}
} @tiangolo, if it is required, I could add a section for nginx here in the documentation. |
I'm trying to set
root_path
to uvicorn as suggested [1] using this image, but don't see any options to pass arguments:How can I do it?
Refs:
The text was updated successfully, but these errors were encountered: