WindowsでのNginxTCPプロキシサービスの構成

NginxはWebプロキシサーバーとして使用されるだけではありません(httpおよびhttpsプロトコルをサポート), 通常のTCPプロキシサーバーとしても使用できます,TCPポートをサポート, TCPなど 3306, 3690, 3389, 22 等々.

以下の機能を実現できます. クライアントはソースサーバーAとソースサーバーBに直接アクセスできません, しかし、サーバーCは. サーバーCでプロキシサービスを構成します, したがって、クライアントはサーバーCのプロキシサービスを介してサーバーAとサーバーBにアクセスできます。.

この一節で, nginxTCPプロキシサービスの構成を簡単に紹介します.

NGINXバージョン

nginx / 1.13.3

準拠パラメータ


TLSSNIサポートが有効
引数を構成する: –with-cc = cl \
–builddir = objs.msvc8 \
–with-debug \
–プレフィックス= \
–conf-path = conf / nginx.conf \
–pid-path = logs / nginx.pid \
–http-log-path = logs / access.log \
–error-log-path = logs / error.log \
–sbin-path = nginx.exe \
–http-client-body-temp-path = temp / client_body_temp \
–http-proxy-temp-path = temp / proxy_temp \
–http-fastcgi-temp-path = temp / fastcgi_temp \
–http-scgi-temp-path = temp / scgi_temp \
–http-uwsgi-temp-path = temp / uwsgi_temp \
–with-cc-opt = -DFD_SETSIZE = 1024 \
–with-pcre = objs.msvc8 / lib / pcre-8.40 \
–with-zlib = objs.msvc8 / lib / zlib-1.2.11 \
–with-select_module \
–と-http_v2_module \
–と-http_realip_module \
–with-http_addition_module \
–と-http_sub_module \
–と-http_dav_module \
–と-http_stub_status_module \
–と-http_flv_module \
–と-http_mp4_module \
–と-http_gunzip_module \
–と-http_gzip_static_module \
–with-http_auth_request_module \
–と-http_random_index_module \
–with-http_secure_link_module \
–と-http_slice_module \
–メール付き \
–with-stream \
–with-openssl = objs.msvc8 / lib / openssl-1.0.2l \
–with-openssl-opt = no-asm \
–と-http_ssl_module \
–with-mail_ssl_module \
–with-stream_ssl_module

nginx.confのパラメーター


ユーザー誰も;
worker_processes 2;
イベント {
worker_connections 1024;
}
ストリーム {
vhost/*。confを含める;
アップストリームmofnet {
サーバーIP_A:PORT_A;
}
アップストリームmojnet {
サーバーIP_B:PORT_B;
}
}

ホストAのパラメータ


サーバ {
PORT_Cを聞く;
proxy_pass IP_A;
}

ホストBのパラメータ


サーバ {
PORT_Dを聞く;
proxy_pass IP_B;
}

返信を残します