时间:2021-07-01 10:21:17 帮助过:41人阅读
nginx 配置mysql代理 -- 基于nginx1.9以上 stream module
stream 模块用于一般的 TCP 代理和负载均衡。
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } stream { upstream sql { server 172.16.10.229:3306 weight=1 max_fails=2 fail_timeout=30s; } server { listen 3333; proxy_connect_timeout 1s; proxy_timeout 3s; proxy_pass sql; } }
nginx配置Sql server服务代理
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } stream { upstream sqlserver { server 172.16.10.167:1433 weight=1 max_fails=2 fail_timeout=30s; } server { listen 3334; proxy_connect_timeout 1s; proxy_timeout 3s; proxy_pass sqlserver; } }
nginx配置Oracle代理
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } stream { upstream oracle { server 172.16.10.222:1521 weight=1 max_fails=2 fail_timeout=30s; } server { listen 3335; proxy_connect_timeout 1s; proxy_timeout 3s; proxy_pass oracle; } }
Nginx配置WebService、MySQL、SQL Server、ORACLE等代理
标签:ade status bytes har tcp str default nbsp not