-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdjango
48 lines (38 loc) · 1.15 KB
/
django
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
upstream app_server {
server unix:/home/django/gunicorn.socket fail_timeout=0;
}
server {
listen 80 ;
listen [::]:80 ;
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 4G;
server_name pinmyblogs.com www.pinmyblogs.com;
keepalive_timeout 5;
# Your Django project's media files - amend as required
location /media {
access_log off;
alias /home/django/pinmyblogs/pinmyblogs/media;
}
# your Django project's static files - amend as required
location /static {
access_log off;
add_header Cache-Control public;
add_header Pragma public;
add_header Vary Accept-Encoding;
expires 7d;
alias /home/django/pinmyblogs/static;
}
# Proxy the static assests for the Django Admin panel
location /static/admin {
access_log off;
alias /usr/lib/python2.7/dist-packages/django/contrib/admin/static/admin/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
proxy_buffering off;
proxy_pass http://app_server;
}
}