The following diagram shows how our final production environment will look:
The following will happen when the client browser launches an HTTP request:
- NGINX receives the HTTP request.
- If a static file is requested, NGINX serves the static file directly. If a dynamic page is requested, NGINX delegates the request to uWSGI through a socket.
- uWSGI passes the request to Django for processing. The resulting HTTP response is passed back to NGINX, which in turn passes it back to the client browser.