forked from luzfcb/django-template-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
30 lines (24 loc) · 796 Bytes
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
server_names_hash_bucket_size 64;
upstream {{ project_name }}_gunicorn {
server unix:/webapps/{{ project_name }}/run/gunicorn.sock fail_timeout=0;
}
server {
listen 80;
access_log /var/log/nginx/{{ project_name }}.access.log;
error_log /var/log/nginx/{{ project_name }}.error.log;
location /static/ {
alias /webapps/{{ project_name }}/{{ project_name }}/static/;
}
location /media/ {
alias /webapps/{{ project_name }}/{{ project_name }}/media/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
if (!-f $request_filename) {
proxy_pass http://{{ project_name }}_gunicorn;
break;
}
}
}