Nginx反向代理Mysql
数据库过大(懒得同步),该服务器又没有公网环境,索性让有公网IP的服务器做个代理。
http{
...
}
stream {
upstream mysql {
hash $remote_addr consistent;
server 10.0.10.2:3306 weight=5 max_fails=5 fail_timeout=30s;
}
server {
listen 3306;
proxy_connect_timeout 30s;
proxy_timeout 300s;
proxy_pass mysql;
}
}
本文来自博客园,作者:MegaloBox,转载请注明原文链接:https://www.cnblogs.com/cpw6/p/14205906.html