server {
listen 80;
client_max_body_size 20M;
location /static/ {
autoindex on;
root /var/www/RandomBox/;
}
location /media/ {
autoindex on;
root /var/www/RandomBox/;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 1w;
log_not_found off;
}
location / {
proxy_pass http://0.0.0.0:8001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
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-Host $server_name;
}
}