Nginx configuration WebService, MySQL, SQL Server, Oracle and other agents

Source: Internet
Author: User

Nginx Configuration WebService

#user nobody;worker_processes4; #error_log logs/Error.log, #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid;events {worker_connections1024x768;}    HTTP {include mime.types; Default_type Application/octet-stream; Log_format Main'$remote _addr-$remote _user [$time _local] "$request"'                      '$status $body _bytes_sent "$http _referer"'                      '"$http _user_agent" "$http _x_forwarded_for "'; #access_log logs/Access.log Main;    Sendfile on;    #tcp_nopush on; #keepalive_timeout0; Keepalive_timeout $; Upstream Esbserver {server127.0.0.1:8083weight=1max_fails=2fail_timeout=30s;    } #gzip on; server {Listen8081;        server_name localhost; #charset Koi8-0; #access_log logs/Host.access.log Main; Location/ladder_web {proxy_set_header X-real-IP $remote _addr; Proxy_pass http://Esbserver;        }           }}

Nginx config MySQL proxy--based on nginx1.9 above stream module
The stream module is used for general TCP proxies and load balancing.

#user nobody;worker_processes1; #error_log logs/Error.log, #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid;events {worker_connections1024x768;} Stream {Upstream SQL {server172.16.10.229:3306weight=1max_fails=2fail_timeout=30s; } Server {Listen3333;        Proxy_connect_timeout 1s;        Proxy_timeout 3s;    Proxy_pass SQL; }}

Nginx Configuration SQL Server service Proxy

#user nobody;worker_processes1; #error_log logs/Error.log, #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid;events {worker_connections1024x768;} stream {Upstream SQL Server {server172.16.10.167:1433weight=1max_fails=2fail_timeout=30s; } Server {Listen3334;        Proxy_connect_timeout 1s;        Proxy_timeout 3s;    Proxy_pass SQL Server; }}

Nginx Configuration Oracle Proxy

#user nobody;worker_processes1; #error_log logs/Error.log, #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid;events {worker_connections1024x768;} Stream {Upstream Oracle {server172.16.10.222:1521weight=1max_fails=2fail_timeout=30s; } Server {Listen3335;        Proxy_connect_timeout 1s;        Proxy_timeout 3s;    Proxy_pass Oracle; }}

Nginx configuration WebService, MySQL, SQL Server, Oracle and other agents

Related Article

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.