-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
265 lines (211 loc) · 7.13 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
worker_processes 4;
worker_rlimit_nofile 1024;
events {
use epoll;
worker_connections 10240;
}
http {
include mime.types;
default_type application/octet-stream;
# include proxy.conf;
log_format yundns_log '$upstream_addr [$time_local] "$request" $status $body_bytes_sent $request_time-$upstream_response_time "$http_user_agent" $remote_addr';
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
access_log /mnt1/logs/nginx/access.log yundns_log;
error_log /mnt1/logs/nginx/error.log;
proxy_temp_path /mnt/tmp/proxy_temp_dir;
proxy_cache_path /mnt/tmp/proxy_cache_dir levels=1:2 keys_zone=nginx_cache:500m inactive=3d max_size=30g;
server_tokens off;
sendfile on;
tcp_nopush on;
server_names_hash_bucket_size 256;
client_header_buffer_size 256k;
#large_client_header_buffers 4 32k;
large_client_header_buffers 4 256k;
client_body_buffer_size 256k;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 50m;
keepalive_timeout 120;
fastcgi_intercept_errors on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
#fastcgi_buffer_size 64k;
#fastcgi_buffers 8 64k;
#fastcgi_busy_buffers_size 128k;
#fastcgi_temp_file_write_size 128k;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
underscores_in_headers on;
upstream web {
# ip_hash;
# server 10.168.2.13:8100;
# server 10.171.225.58:8100;
# server 10.168.2.13:8100 max_fails=1 fail_timeout=3s weight=9;
# server 10.171.225.58:8100 max_fails=1 fail_timeout=3s weight=9;
server 10.24.152.125:8100 max_fails=1 fail_timeout=3s weight=9;
}
upstream web-test {
server 10.171.225.58:8200;
}
upstream donguo {
server 127.0.0.1:3200 weight=5;
server 10.47.123.121:3200 weight=5;
keepalive 1000;
}
upstream m.donguo {
server 10.47.123.121:3200 weight=5;
}
upstream local.donguo {
# server 180.172.125.70:3200 weight=5;
server shlever.oicp.net:8082 weight=5;
}
upstream localhost.donguo {
server 127.0.0.1:3200;
}
upstream tracking.donguo {
server 10.24.252.253:8203 weight=5;
}
server { # simple reverse-proxy
listen 80;
server_name jiao.99yxa.com;
root /opt/app/wld_node/public/bd/;
location / {
index baidu_bd_3.html;
}
}
server { # simple reverse-proxy
listen 80;
server_name donguo.me jump.donguo.me www.donguo.me www.kidedu.me kidedu.me www.kaolaedu.me kaolaedu.me www.koalaedu.cn koalaedu.cn;
location / {
proxy_pass http://donguo;
}
location /local/ {
rewrite /local/(.*) /$1 break;
proxy_pass http://local.donguo.me;
}
}
server { # simple reverse-proxy
listen 443 ssl;
server_name donguo.me www.donguo.me www.kidedu.me kidedu.me www.kaolaedu.me kaolaedu.me www.koalaedu.cn koalaedu.cn;
ssl_certificate /opt/app/wld_node/ssl/1_donguo.me_bundle.crt;
ssl_certificate_key /opt/app/wld_node/ssl/2_donguo.me.key;
location / {
proxy_pass http://donguo;
}
location /local/ {
rewrite /local/(.*) /$1 break;
proxy_pass http://local.donguo.me;
}
}
server { # simple reverse-proxy
listen 80;
server_name m.donguo.me;
location / {
proxy_pass http://m.donguo;
}
}
server { # simple reverse-proxy
listen 80;
server_name local.donguo.me;
location / {
proxy_pass http://local.donguo;
}
}
server { # simple reverse-proxy
listen 443 ssl;
server_name local.donguo.me;
ssl_certificate /opt/app/wld_node/ssl/1_donguo.me_bundle.crt;
ssl_certificate_key /opt/app/wld_node/ssl/2_donguo.me.key;
location / {
proxy_pass http://local.donguo;
}
}
server {
listen 443 ssl;
server_name tracking.donguo.me;
ssl_certificate /opt/app/wld_node/ssl/1_donguo.me_bundle.crt;
ssl_certificate_key /opt/app/wld_node/ssl/2_donguo.me.key;
location / {
proxy_pass http://tracking.donguo;
}
}
server {
listen 8080 default_server;
server_name test.wuyueli.com;
location ~ .*ypw* {
proxy_pass http://web-test;
}
}
server {
listen 80 default_server;
server_name localhost;
location / {
root /mnt/alidata/resource/website/web;
index index.htm;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico)$ {
root /mnt/alidata/resource;
}
location ~ .*\.(txt|js|css|woff|html|apk)$ {
root /mnt/alidata/resource;
}
location ~ .*ypw* {
proxy_pass http://web;
}
location ~ .*11download* {
rewrite ^/ http://a.app.qq.com/o/simple.jsp?pkgname=com.youpin.wuyue;
}
location ~ .*shop14470843/koudaitong* {
rewrite ^/ http://shop14470843.koudaitong.com/v2/showcase/homepage?kdt_id=14278675;
}
location ~ .*shop13583387/koudaitong* {
rewrite ^/ http://shop13583387.koudaitong.com/v2/showcase/homepage?kdt_id=13391219;
}
#location / {
# root html;
# index index.html index.htm;
#}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
}