|
@@ -24,6 +24,16 @@ server {
|
|
|
|
|
|
|
|
location /media/ {
|
|
location /media/ {
|
|
|
alias /app/mediafiles/;
|
|
alias /app/mediafiles/;
|
|
|
|
|
+ expires 1y;
|
|
|
|
|
+ add_header Cache-Control "public, max-age=31536000, immutable";
|
|
|
|
|
+
|
|
|
|
|
+ # Optimize for small files, combine small packets, and send directly
|
|
|
|
|
+ tcp_nodelay on;
|
|
|
|
|
+ tcp_nopush on;
|
|
|
|
|
+ sendfile on;
|
|
|
|
|
+
|
|
|
|
|
+ # Logging off for high-traffic image serving
|
|
|
|
|
+ access_log off;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
error_page 500 502 503 504 /50x.html;
|