user www www;
worker_processes
8
;
worker_cpu_affinity
00000001
00000010
00000100
00001000
00010000
00100000
01000000
10000000
;
pid /usr/local/nginx/nginx.pid;
worker_rlimit_nofile
102400
;
events
{
use
epoll;
worker_connections
102400
;
}
http
{
include
mime.types;
default_type application/octet-stream;
fastcgi_intercept_errors on;
charset utf-
8
;
server_names_hash_bucket_size
128
;
client_header_buffer_size 4k;
large_client_header_buffers
4
32k;
client_max_body_size 300m;
sendfile on;
tcp_nopush on;
keepalive_timeout
60
;
tcp_nodelay on;
client_body_buffer_size 512k;
proxy_connect_timeout
5
;
proxy_read_timeout
60
;
proxy_send_timeout
5
;
proxy_buffer_size 16k;
proxy_buffers
4
64k;
proxy_busy_buffers_size 128k;
proxy_temp_file_write_size 128k;
gzip on;
gzip_min_length 1k;
gzip_buffers
4
16k;
gzip_http_version
1.1
;
gzip_comp_level
2
;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_
var
y on;
###
2012
-
12
-
19
change nginx logs
log_format main
'$http_x_forwarded_for - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $request_time $remote_addr'
;
#这里为后端服务器wugk应用集群配置,根据后端实际情况修改即可,tdt_wugk为负载均衡名称,可以任意指定
#但必须跟vhosts.conf虚拟主机的pass段一致,否则不能转发后端的请求。
upstream tdt_wugk {
server
10.10
.
141.30
:
8080
weight=1max_fails=2fail_timeout=30s;
server
10.10
.
141.30
:
8081
weight=1max_fails=2fail_timeout=30s;
server
10.10
.
141.31
:
8080
weight=1max_fails=2fail_timeout=30s;
server
10.10
.
141.31
:
8081
weight=1max_fails=2fail_timeout=30s;
server
10.10
.
141.32
:
8080
weight=1max_fails=2fail_timeout=30s;
server
10.10
.
141.32
:
8081
weight=1max_fails=2fail_timeout=30s;
}
#这里为后端APP应用负载均衡配置,根据后端实际情况修改即可。tdt_app为负载均衡名称,可以任意指定
upstream tdt_app {
server
10.10
.
141.40
:
8080
weight=1max_fails=2fail_timeout=30s;
server
10.10
.
141.40
:
8081
weight=1max_fails=2fail_timeout=30s;
server
10.10
.
141.41
:
8080
weight=1max_fails=2fail_timeout=30s;
server
10.10
.
141.41
:
8081
weight=1max_fails=2fail_timeout=30s;
server
10.10
.
141.42
:
8080
weight=1max_fails=2fail_timeout=30s;
server
10.10
.
141.42
:
8081
weight=1max_fails=2fail_timeout=30s;
}
#
include
引用vhosts.conf,该文件主要用于配置Nginx 虚拟主机
include
vhosts.conf;
}