nginx主配置文件最外层增加如下配置
#mysql代理
stream {
log_format proxy '$remote_addr [$time_local] '
'$protocol $status $bytes_sent $bytes_received '
'$session_time "$upstream_addr" '
'"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"';
access_log /www/wwwlogs/mysql-daili-access.log proxy;
upstream mysql_server {
server 172.20.245.71:3306;
}
server {
listen 3306;
proxy_pass mysql_server;
}
}
- THE END -
最后修改:2023年4月27日
非特殊说明,本博所有文章均为博主原创。
如若转载,请注明出处:https://www.95app.top/nginx-%e4%bb%a3%e7%90%86%e5%86%85%e7%bd%91mysql/