光辉岁月

nginx 代理tcp

nginx 代理tcp

nginx.conf 追加配置

include /etc/nginx/tcp/*.conf;

增加配置文件 vim /etc/nginx/tcp/tcp.conf

stream {
  upstream tcp_proxy {
    server 192.168.10.100:3000  max_fails=3 fail_timeout=30s;
  }

server {
  listen 3001 so_keepalive=on;
    proxy_connect_timeout 30s;
    proxy_timeout 30s;
    proxy_pass tcp_proxy;
  }
}

posted @ 2020-06-02 17:33  taiman  阅读(407)  评论(0编辑  收藏  举报
哈哈哈