• nginx.conf
#在文件最后添加
#mysql proxy
stream{
    server{
        listen 3303;
        proxy_pass db;
    }

    upstream db{
        server 127.0.0.1:3308 weight=1;
        server 127.0.0.1:3310 weight=1;
        server 127.0.0.1:3312 weight=1;
    }

}
  • 命令行运行nginx
>nginx.exe 或者start nginx.exe
>nginx -s stop #停止服务 或者nginx -s quit
>nginx -s reload #重载nginx配置