August 2017
Intermediate to advanced
278 pages
8h 53m
English
The first configuration item we tweak is the favicon:
location = /favicon.ico { access_log off; log_not_found off; }
There's a very famous story of Instagram's first deployment (where they had 10,000 users in the first day) and the load that a missing favicon generated (since Django had to produce the 404 error) caused significant scaling issues.
Next, we serve any of the uploaded and static media directly via NGINX:
location /static|/media {
root /var/www/djangodemo/;
}
These directories are mapped via the STATIC_ROOT and MEDIA_ROOT configuration lines within the settings.py file for Django. NGINX is very efficient at serving static media, so serving it directly produces as little overhead as possible.
We then map app's ...
Read now
Unlock full access