-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
69 lines (55 loc) · 1.79 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
uwsgi_cache_path /ssd/cache/nginx/phonecongress.com levels=1:2 keys_zone=phonecongress.com:100m inactive=72h max_size=1g;
server {
listen 80;
listen [::]:80;
server_name phonecongress.com;
location /.well-known/acme-challenge/ {
alias /etc/ssl/local/acme-wk-public/;
}
location / {
rewrite /(.*) https://phonecongress.com/$1 permanent;
access_log off;
}
}
server {
listen 72.249.66.164:443 ssl spdy;
# TODO: ipv6 ssl?
ssl_certificate /etc/ssl/local/ssl_certificate.crt;
ssl_certificate_key /etc/ssl/local/ssl_certificate.key;
include /etc/nginx/nginx-ssl.conf;
server_name phonecongress.com;
access_log /ssd/logs/phonecongress/access_log combined buffer=32k;
root /home/govtrack/phonecongress.com/public-static/root;
error_page 503 @maintenance;
location @maintenance {
rewrite (.*) /static/maintenance.html last;
}
location / {
#return 503; # maintenance mode activated
include uwsgi_params;
uwsgi_pass unix:///tmp/uwsgi_govtrack_phonecong.sock;
uwsgi_read_timeout 20s;
uwsgi_cache phonecongress.com;
uwsgi_cache_key "$scheme$request_method$host$request_uri";
uwsgi_cache_valid 200 1h;
uwsgi_cache_valid 301 5m;
uwsgi_cache_valid 404 60s;
uwsgi_cache_valid any 5s;
uwsgi_cache_use_stale timeout invalid_header updating;
uwsgi_no_cache $arg_nocache;
uwsgi_cache_bypass $arg_nocache;
}
location /static/ {
alias /home/govtrack/phonecongress.com/public-static/;
expires 7d;
}
location ~ ^/(robots.txt|favicon.ico|googleee0a61280d69c714.html)$ {
root /home/govtrack/web/static;
expires 3d;
}
gzip on;
gzip_min_length 1000;
gzip_types text/plain application/xml application/json text/css application/x-javascript;
gzip_disable "MSIE [1-6]\.";
gzip_vary on;
}