zoukankan      html  css  js  c++  java
  • nginx配置tcp端口转发

    1、安装nginx,网上搜一大堆,不赘述。

    2、启用stream

       cd nginx-1.9.9

       ./configure --with-stream

       make & make install

       ps -ef|grep nginx

       kill -QUIT (master对应的进程号)

       ./nginx

    3、配置tcp端口映射

    events {
    worker_connections 1024;
    }
    stream {

    upstream tcpLink {

    hash $remote_addr consistent;

    server 122.112.209.30:9299 weight=5 max_fails=3 fail_timeout=30s;
    }

    server {

    listen 9900;

    proxy_connect_timeout 1s;

    proxy_timeout 3s;

    proxy_pass tcpLink;

    }

    upstream tcpLink1 {

    hash $remote_addr consistent;

    server 122.112.177.145:9099 weight=5 max_fails=3 fail_timeout=30s;
    }

    server {

    listen 9911;

    proxy_connect_timeout 1s;

    proxy_timeout 3s;

    proxy_pass tcpLink1;

    }
    }
    http {
    include mime.types;
    default_type application/octet-stream;
    }

    4、重启nginx

  • 相关阅读:
    中文转数字
    半角全角互转
    sql快速查记录数
    杀进程批处理
    线程基本用法
    sql游标用法示例
    BUGFREE的使用
    SQL常用函数
    ASP.NET 2.0 下的验证码控件
    经典sql语句
  • 原文地址:https://www.cnblogs.com/jianwei-dai/p/12156544.html
Copyright © 2011-2022 走看看