牛骨文教育服务平台(让学习变的简单)
博文笔记

配置nginx负载TCP服务器

创建时间:2016-06-04 投稿人: 浏览次数:1807

--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;
    }   

}

声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。