-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
82 lines (67 loc) · 2.48 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
worker_processes auto;
worker_rlimit_nofile 999999;
events {
use epoll;
worker_connections 512000;
multi_accept on;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr $host $remote_user [$time_iso8601] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$request_time $upstream_response_time '
'$upstream_addr $upstream_cache_status $upstream_status ';
log_format kefu '$remote_addr $cookie_targetServer $host [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'$request_time $upstream_response_time $upstream_status $upstream_addr';
access_log logs/access.log main;
error_log logs/error.log;
ssl_session_cache shared:SSL:500m;
ssl_session_timeout 10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # disable SSLv3
limit_req_zone $uri zone=one:30m rate=30r/s;
limit_req_zone $uri zone=two:30m rate=100r/s;
limit_conn_zone $binary_remote_addr zone=three:10m;
sendfile on;
tcp_nopush on;
keepalive_timeout 65;
send_timeout 20s;
client_body_timeout 100;
client_body_buffer_size 128k;
client_max_body_size 10m;
client_header_timeout 100;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
types_hash_max_size 2048;
types_hash_bucket_size 64;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 5;
gzip_proxied expired no-cache no-store private auth;
gzip_vary on;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css application/json;
gzip_disable msie6;
# include /data/apps/config/nginx/conf.d/maintenance.conf.off;
include conf.d/*.conf;
}
tcp {
upstream proxy_name {
# simple round-robin
server cloudapi.xiaoi.com:443;
check interval=3000 rise=2 fall=5 timeout=10000;
#check interval=3000 rise=2 fall=5timeout=1000
#check interval=3000 rise=2 fall=5timeout=1000
#check_http_send "GET /HTTP/1.0\r\n\r\n";
#check_http_expect_alive http_2xxhttp_3xx;
}
server {
listen 443;
access_log logs/tcp_access.log;
proxy_pass proxy_name;
}
}