You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
934 B
36 lines
934 B
upstream django_backend {
|
|
server web:8000;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
client_max_body_size 100M;
|
|
|
|
# Gzip compression
|
|
gzip on;
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
|
|
|
# Static files
|
|
location /static/ {
|
|
alias /usr/src/app/staticfiles/;
|
|
expires 30d;
|
|
add_header Cache-Control "public, no-transform";
|
|
}
|
|
|
|
# Media files
|
|
location /media/ {
|
|
alias /usr/src/app/media/;
|
|
expires 7d;
|
|
add_header Cache-Control "public, no-transform";
|
|
}
|
|
|
|
# Django application proxy
|
|
location / {
|
|
proxy_pass http://django_backend;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header Host $host;
|
|
proxy_redirect off;
|
|
}
|
|
}
|