01 user www www;
02 worker_processes 8;
03 worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;
04 pid /usr/local/nginx/nginx.pid;
05
06 worker_rlimit_nofile 102400;
07
08 events
09 {
10 use epoll;
11 worker_connections 102400;
12 }
13 http
14 {
15 include mime.types;
16
17 default_type application/octet-stream;
18
19 fastcgi_intercept_errors on;
20
21 charset utf-8;
22
23 server_names_hash_bucket_size 128;
24 client_header_buffer_size 4k;
25 large_client_header_buffers 4 32k;
26 client_max_body_size 300m;
27
28 sendfile on;
29 tcp_nopush on;
30
31 keepalive_timeout 60;
32
33 tcp_nodelay on;
34
35 client_body_buffer_size 512k;
36 proxy_connect_timeout 5;
37 proxy_read_timeout 60;
38 proxy_send_timeout 5;
39 proxy_buffer_size 16k;
40 proxy_buffers 4 64k;
41 proxy_busy_buffers_size 128k;
42 proxy_temp_file_write_size 128k;
43
44 gzipon;
45 gzip_min_length 1k;
46 gzip_buffers 4 16k;
47 gzip_http_version 1.1;
48 gzip_comp_level 2;
49 gzip_types text/plain application/x-javascript text/css application/xml;
50 gzip_vary on;
51
52
53 ###2012-12-19 change nginx logs
54
55 log_format main\'$http_x_forwarded_for - $remote_user [$time_local] "$request" \'
56 \'$status $body_bytes_sent "$http_referer" \'
57 \'"$http_user_agent" $request_time $remote_addr\';
58
59 #这里为后端服务器wugk应用集群配置,根据后端实际情况修改即可,tdt_wugk为负载均衡名称,可以任意指定
60 #但必须跟vhosts.conf虚拟主机的pass段一致,否则不能转发后端的请求。
61 upstream tdt_wugk {
62 server 10.10.141.30:8080 weight=1 max_fails=2 fail_timeout=30s;
63 server 10.10.141.30:8081 weight=1 max_fails=2 fail_timeout=30s;
64 server 10.10.141.31:8080 weight=1 max_fails=2 fail_timeout=30s;
65 server 10.10.141.31:8081 weight=1 max_fails=2 fail_timeout=30s;
66 server 10.10.141.32:8080 weight=1 max_fails=2 fail_timeout=30s;
67 server 10.10.141.32:8081 weight=1 max_fails=2 fail_timeout=30s;
68 }
69 #这里为后端APP应用负载均衡配置,根据后端实际情况修改即可。tdt_app为负载均衡名称,可以任意指定
70 upstream tdt_app {
71 server 10.10.141.40:8080 weight=1 max_fails=2 fail_timeout=30s;
72 server 10.10.141.40:8081 weight=1 max_fails=2 fail_timeout=30s;
73 server 10.10.141.41:8080 weight=1 max_fails=2 fail_timeout=30s;
74 server 10.10.141.41:8081 weight=1 max_fails=2 fail_timeout=30s;
75 server 10.10.141.42:8080 weight=1 max_fails=2 fail_timeout=30s;
76 server 10.10.141.42:8081 weight=1 max_fails=2 fail_timeout=30s;
77 }
78 #include引用vhosts.conf,该文件主要用于配置Nginx 虚拟主机
79 include vhosts.conf;
80 }