'Will Nginx run a Python FastAPI endpoint app?
I don't see this answered directly, so it's confusing. None of the tutorials I can find are using Nginx. They use Uvicorn instead for their examples. I have a running Nginx server hosting my React website. I want to add some data science endpoints using Python to enhance the React website. Can I run the endpoints in Nginx?
Solution 1:[1]
Actually NO, Nginx listen to your fastAPI application through gunicorn. So, you need to run gunicorn and bind it *.sock
file, then Nginx listen to it.
Or you may read from official uvicorn doc, then you can try yourself https://www.uvicorn.org/deployment/
Good Luck
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Otabek G'ulomov |