40 lines
930 B
Nginx Configuration File
40 lines
930 B
Nginx Configuration File
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
upstream django {
|
|
server django_web_prod_atahan:8000;
|
|
}
|
|
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
client_max_body_size 100M;
|
|
|
|
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_redirect off;
|
|
}
|
|
|
|
location /static/ {
|
|
alias /app/staticfiles/;
|
|
expires 30d;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
location /media/ {
|
|
alias /app/media/;
|
|
expires 7d;
|
|
add_header Cache-Control "public";
|
|
}
|
|
}
|
|
}
|