Windows에서 Nginx TCP 프록시 서비스 구성

Nginx는 웹 프록시 서버로만 사용되는 것이 아닙니다.(http 및 https 프로토콜 지원), 일반 TCP 프록시 서버로도 사용할 수 있습니다.,모든 TCP 포트 지원, TCP와 같은 3306, 3690, 3389, 22 등등.

다음과 같은 기능을 실현할 수 있습니다.. 클라이언트는 소스 서버 A와 소스 서버 B에 직접 액세스 할 수 없습니다., 그러나 서버 C는. 서버 C에서 프록시 서비스를 구성합니다., 따라서 클라이언트는 서버 C의 프록시 서비스를 통해 서버 A와 서버 B를 방문 할 수 있습니다..

이 구절에서, nginx TCP 프록시 서비스의 구성을 간략히 소개하겠습니다..

NGINX 버전

nginx / 1.13.3

준수 매개 변수


TLS SNI 지원 활성화
인수 구성: –with-cc = cl \
–builddir = objs.msvc8 \
–디버그 포함 \
–접두사 = \
–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 \
–with-http_v2_module \
–with-http_realip_module \
–with-http_addition_module \
–with-http_sub_module \
–with-http_dav_module \
–with-http_stub_status_module \
–with-http_flv_module \
–with-http_mp4_module \
–with-http_gunzip_module \
–with-http_gzip_static_module \
–with-http_auth_request_module \
–with-http_random_index_module \
–with-http_secure_link_module \
–with-http_slice_module \
–메일로 \
–스트림 \
–with-openssl = objs.msvc8 / lib / openssl-1.0.2l \
–with-openssl-opt = no-asm \
–with-http_ssl_module \
–with-mail_ssl_module \
–with-stream_ssl_module

nginx.conf의 매개 변수


사용자 없음;
작업자 프로세스 2;
이벤트 {
작업자 _ 연결 1024;
}
흐름 {
vhost / *. conf 포함;
업스트림 모프 넷 {
서버 IP_A:PORT_A;
}
업스트림 mojnet {
서버 IP_B:PORT_B;
}
}

HOST A의 매개 변수


섬기는 사람 {
PORT_C 듣기;
proxy_pass IP_A;
}

HOST B의 매개 변수


섬기는 사람 {
PORT_D 듣기;
proxy_pass IP_B;
}

답장을 남겨주세요