Nginx反向代理Mysql
在nginx.conf最后添加
stream {
include /home/hadoop/nginx/conf/appconfig.d/*.conf;
}
创建目录
mkdir -p /home/hadoop/nginx/conf/appconfig.d
cd /home/hadoop/nginx/conf/appconfig.d
touch mysql.conf
vi mysql.conf
upstream mysql {
server 172.31.1.142:9030;
}
server {
listen 192.168.1.111:9030;
proxy_connect_timeout 10m;
proxy_timeout 24h;
proxy_pass mysql;
}
Nginx反向代理Mysql
https://www.hechunyu.com/archives/nginxfan-xiang-dai-li-mysql