forked from nuance/roaring-tofu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
106 lines (87 loc) · 2.5 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# user nginx;
worker_processes 4;
error_log logs/nginx/error.log;
pid nginx.pid;
events {
worker_connections 1024;
# use epoll;
}
http {
include /usr/local/etc/nginx/mime.types;
default_type application/octet-stream;
access_log logs/nginx/access.log;
keepalive_timeout 65;
proxy_read_timeout 200;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
gzip on;
gzip_min_length 1000;
gzip_proxied any;
gzip_types text/plain text/html text/css text/xml
application/x-javascript application/xml
application/atom+xml text/javascript;
# Only retry if there was a communication error, not a timeout
# on the Tornado server (to avoid propagating "queries of death"
# to all frontends)
proxy_next_upstream error;
# Enumerate all the Tornado servers here
upstream frontends {
server 127.0.0.1:8005;
}
server {
listen 8000;
server_name mhjones.org;
# Allow file uploads
client_max_body_size 50M;
location /static/ {
alias /Users/matt/dev/mhjones/static/;
if ($query_string) {
expires max;
}
}
location = /favicon.ico {
rewrite (.*) /static/favicon.ico;
}
location = /robots.txt {
rewrite (.*) /static/robots.txt;
}
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://frontends;
}
}
server {
listen 8443;
server_name mhjones.org;
ssl on;
ssl_certificate mhjones.org.crt;
ssl_certificate_key mhjones.org.key;
# Allow file uploads
client_max_body_size 50M;
location /static/ {
alias /Users/matt/dev/mhjones/static/;
if ($query_string) {
expires max;
}
}
location = /favicon.ico {
rewrite (.*) /static/favicon.ico;
}
location = /robots.txt {
rewrite (.*) /static/robots.txt;
}
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://frontends;
}
}
}