They are not used in parallel. NGINX is a reverse proxy server . He is the first in line. He accepts incoming connections and decides where they should go next. It also (usually) serves static media such as CSS, JS, and images. It can also perform other functions, such as SSL encryption, caching, etc.
Gunicorn is the next level and is an application server. NGINX sees that the incoming connection is for www.domain.com and knows (via configuration files) that it must transfer this connection to Gunicorn. Gunicorn is a WSGI server that basically consists of:
simple and universal interface between web servers and web applications or frameworks
Gunicorn's task is to manage and run a Django instance (similar to using django-admin runserver during development)
Unlike this setting, Apache is used with the mod_wsgi module. In this situation, the application server is actually part of Apache, working as a module.
Timmy O'Mahony Nov 01 '12 at 18:18 2012-11-01 18:18
source share