Generate production-ready Nginx configurations
Domain names separated by space
Absolute path to your Django project
Path where static files are collected
Root path for media files
Maximum request body size
server {
server_name example.com www.example.com;
client_max_body_size 100M;
charset utf-8;
underscores_in_headers on;
# access_log /home/ubuntu/myproject/logs/nginx-access.log;
error_log /home/ubuntu/myproject/logs/nginx-error.log;
location = /favicon.ico {
access_log off;
log_not_found off;
}
location /static/ {
alias /home/ubuntu/myproject/static/staticfiles/;
}
location /media/ {
root /home/ubuntu/myproject;
client_max_body_size 100M;
}
location / {
include proxy_params;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
proxy_pass http://unix:/run/gunicorn.sock;
}
}