forked from radoraykov/real-life-bug-tracker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gradme.nginx
59 lines (49 loc) · 1.66 KB
/
gradme.nginx
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
uwsgi_cache_path /var/cache/nginx levels=1:2 keys_zone=gradame-cache-one:8m max_size=3000m inactive=600m;
uwsgi_temp_path /var/tmp;
gzip on;
gzip_comp_level 6;
gzip_vary on;
gzip_min_length 1000;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; #text/html
gzip_buffers 16 8k;
upstream gradame_flask {
server unix:///tmp/gradame.sock;
keepalive 64;
}
#server {
# server_name gradame.com;
# return 301 $scheme://www.gradame.com$request_uri;
#}
server {
listen 80;
# listen 443 ssl;
# ssl_certificate /some/location/gradame.com.bundle.crt;
# ssl_certificate_key /some/location/gradame.com.key;
# ssl_protocols SSLv3 TLSv1;
# ssl_ciphers HIGH:!aNULL:!MD5;
server_name gradame.bg;
access_log /home/ubuntu/projects/grada.me/access.log;
# error_page 502 /errors/502.html;
# The ?: prefix is a 'non-capturing' mark, meaning we do not require
# the pattern to be captured into $1 which should help improve performance
location ~ ^/(?:lib/|img/|js/|css/|upload/|robots.txt|humans.txt|favicon.ico) {
root /home/ubuntu/projects/grada.me/static;
access_log off;
expires max;
}
# location /errors {
# internal;
# alias /home/ubuntu/projects/grada.me/static/errors;
# }
location / {
uwsgi_cache gradame-cache-one;
uwsgi_cache_key $request_uri$scheme;
uwsgi_cache_valid 200 302 1h;
uwsgi_cache_valid 301 1d;
uwsgi_cache_valid any 1m;
uwsgi_cache_min_uses 1;
include uwsgi_params;
uwsgi_pass gradame_flask;
}
}