编辑 /etc/nginx/nginx.conf
在文件末尾添加如下内容
stream { server { listen 3307; proxy_connect_timeout 10s; proxy_timeout 200s; proxy_pass localhost:3306; }}
stream {
server {
listen 3307;
proxy_connect_timeout 10s;
proxy_timeout 200s;
proxy_pass localhost:3306;
}
注意:stream要与http在同级目录