Untitled

mail@pastecode.io avatar
unknown
sh
2 years ago
706 B
1
Indexable
Never
user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;


events {
    worker_connections  1024;
}

stream {

#log format
log_format proxy 'Remote IP: $remote_addr [$time_local] '
                 '$status '
                 'Session time: $session_time Upstream host: "$upstream_addr" ';
#log location
access_log /var/log/nginx/db_access.log proxy;

    upstream db_servers {
        least_conn;
        zone db_servers 64k;
        server qa-tidb1:3306;
        server qa-tidb2:3306;
        server qa-tidb3:3306;
    }

    server {
        listen 3306;
        proxy_pass db_servers;
        health_check interval=15 passes=2 fails=2;
    }
}