nginx: A http server acts like apache. It is a portal to handle every request from URL and response to client;
uwsig: A background framework runs working processes behind nginx. nginx transfer http request to uwsig. uwsgi dispatch these request to worker process. After processing, it return result to nginx.
1 It’s dangerous if uwsgi was directly connected by URL request because uwsgi runs program and the codes may be accessed by hacker. nginx protects uwsgi to avoid being touched by outside. For every request, nginx is the only receiver and sender.
2 There are one manger process and several worker processes in uwsgi. Manager process handles every package from nginx. After unpack package, it dispatches data to idle worker process.
3 uwsgi is a framework that designed for python.
4 nginx can response to client directly without transfer request to uwsgi when client request a static webpage. This feature helps to reduce uwsgi work load.
5, For massive web service concurrency, one machine running uwsgi with limit resource like CPU, memory is hard to provide service in a short time. uwsgi can be deployed in multiple machines and nginx transfers requests to different uwsgi based on their work load.