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.
75 lines
1.9 KiB
75 lines
1.9 KiB
worker_processes 1;
|
|
|
|
user www-data;
|
|
pid /var/run/nginx.pid;
|
|
error_log /var/log/nginx/error.log;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
accept_mutex off;
|
|
use epoll;
|
|
}
|
|
|
|
http {
|
|
sendfile on;
|
|
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
keepalive_timeout 65;
|
|
|
|
upstream django {
|
|
server unix:/tmp/gunicorn.sock fail_timeout=0;
|
|
}
|
|
|
|
upstream flower {
|
|
server unix:/tmp/daphne.sock fail_timeout=0;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
charset utf-8;
|
|
keepalive_timeout 5;
|
|
client_max_body_size 64M;
|
|
access_log /var/log/nginx/access.log;
|
|
|
|
location /media {
|
|
alias /opt/app/public/media;
|
|
expires 30d;
|
|
}
|
|
|
|
location /static {
|
|
alias /opt/app/public/static;
|
|
expires 30d;
|
|
}
|
|
|
|
location /flower {
|
|
proxy_pass http://flower;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header Host $http_host;
|
|
proxy_connect_timeout 86400;
|
|
proxy_read_timeout 86400;
|
|
proxy_send_timeout 86400;
|
|
}
|
|
|
|
location / {
|
|
proxy_set_header Host $http_host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Scheme $scheme;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
# we don't want nginx trying to do something clever with
|
|
# redirects, we set the Host: header above already.
|
|
proxy_redirect off;
|
|
proxy_connect_timeout 600;
|
|
proxy_send_timeout 600;
|
|
proxy_read_timeout 600;
|
|
send_timeout 600;
|
|
proxy_http_version 1.1;
|
|
proxy_pass http://django;
|
|
proxy_pass_header Server;
|
|
}
|
|
}
|
|
}
|
|
|