13
MicroPie - "ultra-micro" ASGI web framework
(piefed.social)
Welcome to the Python community on the programming.dev Lemmy instance!
Past
November 2023
October 2023
July 2023
August 2023
September 2023
What's the difference between running uvicorn vs nginx?
Yes could just do a web search, but would like to hear the OP's perspective
Uvicorn and nginx are two completely different things in your web stack. For production, you typically don't expose Uvicorn directly to the public. Instead, nginx receives all traffic, serves static assets efficiently, and forwards dynamic requests to Uvicorn. Uvicorn's website explains each components role in your stack: "Using Nginx as a proxy in front of your Uvicorn processes may not be necessary, but is recommended for additional resilience. Nginx can deal with serving your static media and buffering slow requests, leaving your application servers free from load as much as possible. In managed environments such as Heroku, you won't typically need to configure Nginx, as your server processes will already be running behind load balancing proxies."
The question is not "What's the difference between running uvicorn vs nginx?" But "When should I use Nginx to deploy with Uvicorn?" Hope this makes sense.
Thanks for the explanation.