As explained in the beginning of this chapter, two types of server functionalities are required for dynamic web applications – a web server and application server. The key difference between those two servers is that a web server manages static content while an application handles dynamic content.
The main figure illustrates a use case in Django applications using Nginx as a web server and Gunicorn as an application server. As Nginx handles all requests from clients first, it is also called a reverse proxy server.
The mechanism is as follows:
collectstatic
command, all static files are stored in a particular location that Nginx can also recognize. (This is important for Nginx configurations. We'll explain this later.)STATIC_URL
).As explained in the beginning of this chapter, two types of server functionalities are required for dynamic web applications – a web server and application server. The key difference between those two servers is that a web server manages static content while an application handles dynamic content.
The main figure illustrates a use case in Django applications using Nginx as a web server and Gunicorn as an application server. As Nginx handles all requests from clients first, it is also called a reverse proxy server.
The mechanism is as follows:
collectstatic
command, all static files are stored in a particular location that Nginx can also recognize. (This is important for Nginx configurations. We'll explain this later.)STATIC_URL
).