- Redis / Celery / Celery Beat - кэширование популярных тегов и лучших участников - асинхронные уведомления в Centrifugo - отправка email-уведомлений через Celery - полнотекстовый поиск и подсказки - Docker Compose инфраструктура
46 lines
1.3 KiB
Nginx Configuration File
46 lines
1.3 KiB
Nginx Configuration File
worker_processes auto;
|
|
events { worker_connections 1024; }
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
sendfile on;
|
|
gzip on;
|
|
gzip_types text/plain text/css application/javascript application/json image/svg+xml;
|
|
|
|
proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=django:10m max_size=100m inactive=60m;
|
|
|
|
upstream django {
|
|
server python-app:8000;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
location /static/ {
|
|
alias /var/www/ask_pupkin/static/;
|
|
access_log off;
|
|
expires 30d;
|
|
add_header Cache-Control "public, max-age=2592000";
|
|
}
|
|
|
|
location /media/ {
|
|
alias /var/www/ask_pupkin/uploads/;
|
|
access_log off;
|
|
expires 7d;
|
|
add_header Cache-Control "public, max-age=604800";
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://django;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_cache django;
|
|
proxy_cache_bypass $http_cache_control;
|
|
add_header X-Proxy-Cache $upstream_cache_status;
|
|
}
|
|
}
|
|
}
|