30 lines
591 B
Django/Jinja
30 lines
591 B
Django/Jinja
upstream appserver {
|
|
server localhost:8000 fail_timeout=0;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name {{ host_name }};
|
|
|
|
access_log /var/log/nginx/{{ project_name }}.access.log;
|
|
error_log /var/log/nginx/{{ project_name }}.error.log info;
|
|
|
|
keepalive_timeout 5;
|
|
|
|
location /static {
|
|
alias {{ project_path }}/static;
|
|
}
|
|
|
|
location / {
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $http_host;
|
|
proxy_redirect off;
|
|
proxy_read_timeout 180s;
|
|
|
|
if (-f $request_filename) {
|
|
proxy_pass http://appserver;
|
|
break;
|
|
}
|
|
}
|
|
}
|