Nginx对TCP协议的代理配置

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;  
    }
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。