< 返回

Nginx端口映射TCP

2022-08-18 16:22 作者:136739373 阅读量:717

添加到

  1. /etc/nginx/nginx.conf

添加内容:

  1. stream {
  2. upstream tcpLink {
  3. hash $remote_addr consistent;
  4. server 127.0.0.1:31905 weight=5 max_fails=3 fail_timeout=30s;
  5. }
  6. server {
  7. listen 4008;
  8. proxy_connect_timeout 1s;
  9. proxy_timeout 3s;
  10. proxy_pass tcpLink;
  11. }
  12. }

监听4008,映射到127.0.0.1:31905,名字tcpLink。

联系我们
返回顶部