zoukankan      html  css  js  c++  java
  • nginx四层代理

    Nginx 四层代理理仅能存在于 main 段,以下是代理的配置

    stream {
      upstream ssh_proxy {
      hash $remote_addr consistent;
      server 192.168.1.10:22;      #实际的服务器IP及端口
    }
      upstream mysql_proxy {
      hash $remote_addr consistent;
      server 192.168.1.10:3306;     #实际的服务器IP及端口,这里指向的是MySQL 端口
    }
      server {
        listen 6666;           #代理服务器的端口
        proxy_connect_timeout 1s;
        proxy_timeout 300s;
        proxy_pass ssh_proxy;     #指向代理 指向上面的-->upstream ssh_proxy
      }
      server {
        listen 5555;
        proxy_connect_timeout 1s;
        proxy_timeout 300s;
        proxy_pass mysql_proxy;   #指向代理,指向上面的-->mysql_proxy
        }
    }

    设定完毕后,

    nginx -t  -c /etc/nginx/nginx.conf
    nginx -s reload -c /etc/nginx/nginx.conf

    查看端口

    ss -lnt /netstaut -lntp

  • 相关阅读:
    MathML
    Redux counterpart rematch dva
    flow
    pauseable 库
    a simple machine learning system demo, for ML study.
    react图工具集成
    SQLite
    Celery
    RabbitMQ installation
    Thunk
  • 原文地址:https://www.cnblogs.com/tingxin/p/12984553.html
Copyright © 2011-2022 走看看