打赏

星辰大海ゞ

That which does not kill us makes us stronger!

导航

使用Nginx转发tcp请求--四层透明代理

要求nginx版本大于1.9,
在nginx.conf添加以下,要求和http{}同级

worker_processes  6;
events { worker_connections 1024; }

stream { upstream cakehouse { server
172.17.210.101:10001 weight=5 max_fails=2 fail_timeout=30s ; } server { listen 8888; proxy_connect_timeout 10s; proxy_timeout 5s; proxy_pass cakehouse; } }

 

前提编译时需要加载--with-stream模块

 # ./configure --with-stream

 

 

posted on 2019-09-03 17:16  星辰大海ゞ  阅读(5269)  评论(0编辑  收藏  举报