Konfiguration des Nginx TCP-Proxy-Dienstes in Windows

Nginx wird nicht nur als Webproxyserver verwendet(Unterstützung des http- und https-Protokolls), Es kann auch als normaler TCP-Proxyserver verwendet werden,Unterstützung für jeden TCP-Port, wie TCP 3306, 3690, 3389, 22 und so weiter.

Es kann die folgende Funktion realisieren. Client kann nicht direkt auf Quellserver A und Quellserver B zugreifen, aber Server C kann. wir konfigurieren den Proxy-Dienst auf Server C, Somit kann der Client Server A und Server B über den Proxy-Dienst auf Server C besuchen.

In dieser Passage, Ich werde die Konfiguration des nginx TCP-Proxy-Dienstes kurz vorstellen.

NGINX-Version

nginx/1.13.3

Erfüllter Parameter


TLS SNI-Unterstützung aktiviert
Argumente konfigurieren: –with-cc=cl \
–builddir=objs.msvc8 \
–mit-debuggen \
–Präfix= \
–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 \
–mit-http_addition_module \
–with-http_sub_module \
–mit-http_dav_module \
–with-http_stub_status_module \
–with-http_flv_module \
–with-http_mp4_module \
–mit-http_gunzip_module \
–with-http_gzip_static_module \
–mit-http_auth_request_module \
–mit-http_random_index_module \
–mit-http_secure_link_module \
–mit-http_slice_module \
–mit-mail \
–With-Stream \
–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

Parameter von nginx.conf


Benutzer niemand;
worker_processes 2;
Veranstaltungen {
worker_connections 1024;
}
Strom {
include vhost / *. conf;
Upstream-Mofnet {
Server-IP_A:PORT_A;
}
Upstream-Mojnet {
Server-IP_B:PORT_B;
}
}

Parameter von HOST A


Server {
hören PORT_C;
proxy_pass IP_A;
}

Parameter von HOST B


Server {
hören PORT_D;
proxy_pass IP_B;
}

Hinterlasse eine Antwort