要放在http之前
#tcp_proxy stream { upstream tcp_proxy{ hash $remote_addr consistent; server 192.168.8.56:4809; #需代理的IP+PORT } server { listen 4111; proxy_connect_timeout 1s; proxy_timeout 3s; proxy_pass tcp_proxy; } }