[root@zhyly-pre-003 4-layer-conf.d]# cat mysql.conf
upstream mysql {
server 192.168.2.6:3306;
}
server {
listen 8083;
proxy_pass mysql;
}
[root@zhyly-pre-003 4-layer-conf.d]# /usr/local/nginx/sbin/nginx -s reload
stream {
upstream rds {
server 10.27.166.107:33086 max_fails=3 fail_timeout=30s;
}
server {
listen 8085;
proxy_connect_timeout 2s; #后端服务器连接的超时时间_发起握手等候响应超时时间(默认60秒)
proxy_timeout 900s; #接收后端响应内容超时
proxy_pass rds;
}
}
标签:timeout,代理,server,nginx,proxy,conf,mysql
From: https://www.cnblogs.com/anslinux/p/17154406.html