nginx1.9+ New TCP/UDP Agent Stream

Source: Internet
Author: User
Tags openssl
nginx1.9+ new TCP/UDP agent Stream
[Root@rhel nginx-1.12.1]#./configure--help--help Print this message--prefix=path Set installation prefix--sbin-path=path set nginx binary pathname--modules-path=              Path set modules path--conf-path=path set nginx.conf pathname--error-log-path=path                   Set error log pathname--pid-path=path set Nginx.pid pathname--lock-path=path
                                     Set Nginx.lock pathname--user=user set non-privileged user for
                                     Worker Processes--group=group set non-privileged Group for Worker processes--build=name Set build NAME--builddir=dir s  ET build directory--with-select_module enable select module--without-select_module disable Select Module--with-Poll_module Enable poll Module--without-poll_module Disable poll module--with-threads Enable thread pool support--with-file-aio enable file AIO support--with-htt P_ssl_module enable Ngx_http_ssl_module--with-http_v2_module enable Ngx_http_v2_module--wit H-http_realip_module enable Ngx_http_realip_module--with-http_addition_module enable Ngx_http_addition_ Module--with-http_xslt_module enable Ngx_http_xslt_module--with-http_xslt_module=dynamic enable Dynami C ngx_http_xslt_module--with-http_image_filter_module Enable Ngx_http_image_filter_module--with-http_image_filter _module=dynamic Enable dynamic Ngx_http_image_filter_module--with-http_geoip_modul E Enable Ngx_http_geoip_module--with-http_geoip_module=dynamic enable dynamic Ngx_http_geoip_module--wit       H-http_sub_module      Enable Ngx_http_sub_module--with-http_dav_module enable Ngx_http_dav_module--with-http_flv_module Enable Ngx_http_flv_module--with-http_mp4_module enable Ngx_http_mp4_module--with-http_gunzi
  P_module enable Ngx_http_gunzip_module--with-http_gzip_static_module enable Ngx_http_gzip_static_module --with-http_auth_request_module enable Ngx_http_auth_request_module--with-http_random_index_module enable Ngx_htt P_random_index_module--with-http_secure_link_module Enable Ngx_http_secure_link_module--with-http_degradation_mo Dule Enable Ngx_http_degradation_module--with-http_slice_module enable Ngx_http_slice_module--with-htt P_stub_status_module Enable Ngx_http_stub_status_module--without-http_charset_module disable Ngx_http_charset _module--without-http_gzip_module Disable Ngx_http_gzip_module--without-http_ssi_module disable _http_ssi_module--witHout-http_userid_module Disable Ngx_http_userid_module--without-http_access_module disable Ngx_http_access_ Module--without-http_auth_basic_module Disable Ngx_http_auth_basic_module--without-http_autoindex_module disabl          E ngx_http_autoindex_module--without-http_geo_module Disable Ngx_http_geo_module--without-http_map_module Disable Ngx_http_map_module--without-http_split_clients_module disable Ngx_http_split_clients_module--withou T-http_referer_module Disable Ngx_http_referer_module--without-http_rewrite_module disable ngx_http_rewrite_m Odule--without-http_proxy_module Disable Ngx_http_proxy_module--without-http_fastcgi_module disable         Http_fastcgi_module--without-http_uwsgi_module Disable Ngx_http_uwsgi_module--without-http_scgi_module Disable Ngx_http_scgi_module--without-http_memcached_module disable Ngx_http_memcached_module--without-http_lim It_conn_module Disable Ngx_http_limit_conn_module--without-http_limit_req_module Disable Ngx_http_limit_req_module--without-http_empty_ Gif_module Disable Ngx_http_empty_gif_module--without-http_browser_module disable Ngx_http_browser_module Ithout-http_upstream_hash_module Disable Ngx_http_upstream_hash_module--without-ht Tp_upstream_ip_hash_module Disable Ngx_http_upstream_ip_hash_module--without-http_ Upstream_least_conn_module Disable Ngx_http_upstream_least_conn_module--without-ht Tp_upstream_keepalive_module Disable Ngx_http_upstream_keepalive_module--without-h Ttp_upstream_zone_module Disable Ngx_http_upstream_zone_module--with-http_perl_mo Dule Enable Ngx_http_perl_module--with-http_perl_module=dynamic enable dynamic Ngx_http_perl_module--w Ith-perl_modules_path=paTH Set Perl modules path--with-perl=path set perl binary pathname--http-log-path=path
                                     Set HTTP access log pathname--http-client-body-temp-path=path set path to store
                                     HTTP client request body temporary files--http-proxy-temp-path=path the set path to store
                                     HTTP proxy temporary files--http-fastcgi-temp-path=path set path to store
                                     HTTP fastcgi temporary files--http-uwsgi-temp-path=path set path to store
                                     HTTP Uwsgi temporary files--http-scgi-temp-path=path set path to store               HTTP scgi Temporary Files--without-http Disable HTTP server--without-http-cache Disable HTTP cache--with-mail enable POP3/IMAP4/SMTP proxy module--with-mail=dynam IC Enable Dynamic POP3/IMAP4/SMTP Proxy module--with-mail_ssl_module enable Ngx_mail_ssl_module--without-mail_pop 3_module Disable Ngx_mail_pop3_module--without-mail_imap_module disable Ngx_mail_imap_module
  T-mail_smtp_module Disable Ngx_mail_smtp_module--with-stream enable TCP/UDP proxy module --with-stream=dynamic Enable dynamic TCP/UDP proxy module--with-stream_ssl_module enable ngx_s         Tream_ssl_module--with-stream_realip_module Enable Ngx_stream_realip_module--with-stream_geoip_module Enable Ngx_stream_geoip_module--with-stream_geoip_module=dynamic enable dynamic Ngx_stream_geoip_module--with-stre Am_ssl_preread_module Enable Ngx_stream_ssl_preread_module--without-stream_limit_conn_module disable NGX_STREAM_        Limit_conn_module--without-stream_access_module Disable Ngx_stream_access_module--without-stream_geo_module Disable Ngx_stream_geo_moduLe--without-stream_map_module disable ngx_stream_map_module--without-stream_split_clients_module Disable Ngx_stream_split_clients_module--without-stream_return_module disable Ngx_stream_r Eturn_module--without-stream_upstream_hash_module Disable Ngx_stream_upstream_hash _module--without-stream_upstream_least_conn_module Disable Ngx_stream_upstream_lea St_conn_module--without-stream_upstream_zone_module Disable Ngx_stream_upstream_zo Ne_module--with-google_perftools_module enable Ngx_google_perftools_module--with-cpp_test_module en          Able Ngx_cpp_test_module--add-module=path Enable external module--add-dynamic-module=path                     Enable dynamic external module--with-compat dynamic modules compatibility--with-cc=path Set C CoMpiler Pathname--with-cpp=path Set C preprocessor pathname--with-cc-opt=options Set                 Additional C Compiler Options--with-ld-opt=options set additional linker options--WITH-CPU-OPT=CPU  Build for the specified CPU, valid values:pentium, Pentiumpro, PENTIUM3,                     Pentium4, Athlon, Opteron, Sparc32, SPARC64, PPC64--without-pcre                    Disable PCRE Library usage--with-pcre Force PCRE Library Usage--with-pcre=dir Set path to PCRE library sources--with-pcre-opt=options set additional builds OPTIONS for PCRE--w Ith-pcre-jit build Pcre with JIT compilation support--with-zlib=dir set path to                zlib Library Sources--with-zlib-opt=options set additional build OPTIONS for zlib--with-zlib-asm=cpu Use zlib AsseMbler sources optimized for the specified CPU, valid values: Pentium, Pentiumpro--with-libatomic Force libatomic_ops Library Usage--with-libatomi C=dir set path to Libatomic_ops library sources--with-openssl=dir set path to OpenSSL Li                       Brary Sources--with-openssl-opt=options Set additional build OPTIONS for OpenSSL--with-debug
 Enable debug logging

#编译./configure--prefix=/servyouapp/nginx \--with-stream \--with-http_stub_status_module

#nginx. conf section configuration stream {Upstream backend {server 10.7.2.86:1521; } server {Listen 8686; Proxy_connect_timeout 8s;  Proxy_timeout 24h; #代理超时 Proxy_pass backend; } }
Simple Stream Configuration

#实现TCP/UDP Agent forwarding, to achieve, LAN to another network segment of the Oracle database TCP proxy forwarding

User  nobody;
Worker_processes  1;
Error_log  logs/error.log  info;

PID        Logs/nginx.pid;


Events {
    worker_connections  2048;
}
Stream {
    Upstream backend {
        server 10.7.2.86:1521;
    }
    server {
        listen 8686;
        Proxy_connect_timeout 8s;
        Proxy_timeout 24h;
        Proxy_pass backend
    }
}
official explanation of the stream

Http://nginx.org/en/docs/stream/ngx_stream_core_module.html

Author: The origin of the log bridge: http://xiaochina.cnblogs.com/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.