Nginx代理Mysql

Nginx代理Mysql
返回Nginx代理Mysql常用代码示例代码片段

vim /etc/nginx/nginx.conf

  1. stream {
  2. upstream mysql {
  3. hash $remote_addr consistent;
  4. server 192.168.10.5:3306 max_fails=3 fail_timeout=30s;
  5. }
  6. server {
  7. listen 3306;
  8. proxy_connect_timeout 30s;
  9. proxy_timeout 600s;
  10. proxy_pass mysql;
  11. }
  12. }
原文链接:https://rumenz.com/examples/Nginx/nginx-mysql-proxy.html
↑回到顶部↑
入门小站 @2018