美文网首页
Nginx对TCP协议的代理配置

Nginx对TCP协议的代理配置

作者: 游园拾忆 | 来源:发表于2018-11-20 11:10 被阅读7次

Nginx 1.90 以上版本增加对tcp协议的支持,但需要配置参数开启代理。

 模块参数 --with-stream –-with-stream_ssl_module

  • 具体配置

http的同级添加stream

stream { 
    upstream tigase5280 { 
        hash $remote_addr consistent; 
        server xxx.com:5280 weight=5; 
    } 
    server {
        listen 443 ssl;
        ssl_certificate ssl/cert-.crt;
        ssl_certificate_key  ssl/cert-.key;
        proxy_connect_timeout 10s;
        proxy_timeout 30s;
        proxy_pass tigase5280;  
    }
}

相关文章

网友评论

      本文标题:Nginx对TCP协议的代理配置

      本文链接:https://www.haomeiwen.com/subject/zgetqqtx.html