-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
77 lines (62 loc) · 1.64 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
proxy_cache_path /var/www/cache keys_zone=cache:10M;
server {
listen 80 default_server ; ## listen for ipv4; this line is default and implied
listen [::]:80 default_server ipv6only=on; ## listen for ipv6
root /var/www/ask_boldyrev;
index index.html index.htm;
gzip on;
gzip_min_length 1024;
# Make site accessible from http://localhost/
server_name localhost muxa-netbook;
location / {
root /var/www/ask_boldyrev/static;
proxy_cache cache;
proxy_cache_valid 1m;
try_files $uri @proxy_to_django;
}
location ^~ /uploads {
proxy_set_header Cache-Control public,max-age=60;
root /var/www/ask_boldyrev;
}
location ~* ^/.+\.(css|jpeg|jpg|png|js)$ {
proxy_set_header Cache-Control public,max-age=60;
root /var/www/ask_boldyrev;
}
location @proxy_to_django {
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:8080;
}
location @proxy_to_gunicorn {
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://127.0.0.1:8081;
}
# gunicorn
location /gunicorn {
proxy_pass http://127.0.0.1:8081;
}
#error_page 404 /404.html;
}
}