forked from lebinh/nginx-conf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx-tcp.conf
135 lines (127 loc) · 4.18 KB
/
nginx-tcp.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
worker_processes 4; ## Default: 1
error_log /nginx-1.15.9/logs/error.log info;
pid logs/nginx.pid;
worker_rlimit_nofile 65535;
#worker_cpu_affinity 00000001 00000010; //is not supported on this platform
events
{
worker_connections 2048; ## Default: 1024
accept_mutex_delay 500ms;
debug_connection 127.0.0.1;
}
http
{
include /nginx-1.15.9/conf/mime.types;
include /nginx-1.15.9/conf/proxy.conf;
include /nginx-1.15.9/conf/fastcgi.conf;
index index.html index.htm index.php;
default_type application/octet-stream;
log_format main '$remote_addr rt=$request_time uct=$upstream_connect_time $remote_user $time_local $status $request $body_bytes_sent $http_referer $http_user_agent $http_x_forwarded_for $request_time $request_length $bytes_sent $gzip_ratio $http_referer';
access_log logs/access.log main;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
client_header_buffer_size 2k;
server_names_hash_bucket_size 128; # this seems to be required for some vhosts
server { # simple reverse-proxy
listen 0.0.0.0:80;
gzip on;
server_name angkorw.cn angkorw.net;
access_log logs/80.access.log main;
root html;
# serve static files
location ~ ^/(images|javascript|js|css|flash|media|static)/ {
root /var/www/virtual/big.server.com/htdocs;
expires 30d;
}
# pass requests for dynamic content to rails/turbogears/zope, et al
location / {
proxy_pass http://127.0.0.1:8080;
}
location = /gateway.txt
{
add_header Access-Control-Allow-Origin *;
alias gateway.txt;
}
}
upstream big_server_com {
#server 47.101.56.224:8899 weight=1;
#server 47.101.176.228:8899 weight=2;
server 127.0.0.1:8080 weight=3;
server 119.188.210.28:8900 weight=4;
}
}
stream
{
open_log_file_cache max=1000 inactive=20s valid=1m min_uses=2;
log_format basic '$time_local [$remote_addr]/[$upstream_addr] $protocol $status $session_time/$upstream_connect_time $bytes_sent/$bytes_received $upstream_bytes_sent/$upstream_bytes_received ';
access_log logs/access-stream.log basic buffer=1k flush=5s;
include *.stream.conf;
#Push山东省济南市 联通
upstream QuotePush
{
hash $remote_addr consistent;
server 111.177.18.54:2688 weight=1 max_fails=1 fail_timeout=1s;#湖北省襄阳市 电信
server 47.103.45.127:2688 weight=2 max_fails=2 fail_timeout=1s;#浙江省杭州市 阿里云
server 110.42.6.125:2688 weight=3 max_fails=3 fail_timeout=1s;#浙江省宁波市 BGP多线
server 119.188.210.28:2688 weight=4 max_fails=4 fail_timeout=1s;#山东省济南市 联通
}
server
{
listen 0.0.0.0:2688;
proxy_connect_timeout 5s;
proxy_timeout 3s;
proxy_pass QuotePush;
}
#Redis-6379
upstream Redis
{
hash $remote_addr consistent;
# server 10.0.0.3:6379 weight=3;
# server 10.0.0.9:6379 weight=3;
server 110.42.6.125:6379 max_fails=3 fail_timeout=30s;
}
server
{
listen 0.0.0.0:6379;
proxy_connect_timeout 5s;
proxy_timeout 3s;
proxy_pass Redis;
}
#ESunny-Product 上海市浦东新区 电信
upstream ESunny-Product
{
server 120.136.160.83:55019 weight=3;
}
server
{
listen 0.0.0.0:55019;
proxy_connect_timeout 5s;
proxy_timeout 3s;
proxy_pass ESunny-Product;
}
#ESunny-Test 河南省郑州市 联通
upstream ESunny-Test
{
server 61.163.243.173:7171 weight=3;
}
server
{
listen 0.0.0.0:7171;
proxy_connect_timeout 5s;
proxy_timeout 3s;
proxy_pass ESunny-Test;
}
#SecureChat-Server 香港
upstream SecureChat-Server
{
server 65.52.173.5:2048 weight=3 max_fails=3 fail_timeout=30s;
}
server
{
listen 0.0.0.0:2048;
proxy_connect_timeout 1s;
proxy_timeout 1s;
proxy_pass SecureChat-Server;
}
}