配置nginx负载TCP服务器,nginx负载tcp
配置nginx负载TCP服务器,nginx负载tcp
--prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/bin/nginx --conf-path=/usr/local/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --pid-path=/var/run/nginx/nginx.pid --user=nginx --group=nginx --with-http_ssl_module --with-http_flv_module --with-http_gzip_static_module --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fcgi --with-http_stub_status_module --with-stream
stream {
upstream obdsocket {
hash $remote_addr consistent;
server 127.0.0.1:8081 weight=5 max_fails=3 fail_timeout=30s;
server 127.0.0.1:8082 weight=5 max_fails=3 fail_timeout=30s;
}
server {
listen 8080;
proxy_connect_timeout 120s;
proxy_timeout 1200s;
proxy_pass obdsocket;
}
}
评论暂时关闭