问题
I see a lot of people running their python app, with nginx, which then communicates to nginx. uWSGI can run directly as a web server, and it looks quite fast and scalable, so what's the purpose of putting nginx in front of that?
回答1:
uWSGI documentation answers this question:
Generally your webserver of choice (Nginx, Mongrel2, etc. will serve static files efficiently and quickly and will simply forward dynamic requests to uWSGI backend nodes.
The uWSGI project has ISPs and PaaS (that is, the hosting market) as the main target, where generally you would want to avoid generating disk I/O on a central server and have each user-dedicated area handle (and account for) that itself. More importantly still, you want to allow customers to customize the way they serve static assets without bothering your system administrator(s).
来源:https://stackoverflow.com/questions/35292550/whats-the-advantage-of-putting-nginx-in-front-of-uwsgi