user www www;
worker_processes ;
error_log logs/error.log;
pid logs/nginx.pid;
worker_rlimit_nofile ;
events {
use epoll;
worker_connections ;
}
http{
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout ;
gzip on;
client_max_body_size 50m;
client_body_buffer_size 256k;
client_header_timeout 3m;
client_body_timeout 3m;
send_timeout 3m;
proxy_connect_timeout 300s; 根后端服务器连接超时时间
proxy_read_timeout 300s; 后端服务器响应时间
proxy_buffer_size 64k; 保存用户头信息缓冲区大小
proxy_buffers 32k; 缓冲区
proxy_busy_buffers_size 64k; 设定高负荷下缓存大小
proxy_temp_file_write_size ; 设定缓存文件夹大小
proxy_ignore_client_abort on; 不允许代理端主动关闭连接 upstream monitor_server {
server 192.168.0.131:;
server 192.168.0.132:;
}
server {
listen ;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page /50x.html;
localtion =/50x.html {
root html;
}
} server {
listen ;
server_name xxx123.tk;
localtion / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://monitor_server;
}
access_log off;
}
}