• nginx 反向代理mysql


    必须是nginx 1.9以上版本

    ./configure --prefix=/export/servers/nginx --sbin-path=/export/servers/nginx/sbin/nginx --conf-path=/export/servers/nginx/conf/nginx.conf --error-log-path=/export/servers/nginx/logs/error.log --http-log-path=/export/servers/nginx/logs/access.log --pid-path=/export/servers/nginx/var/nginx.pid --lock-path=/export/servers/nginx/var/nginx.lock --http-client-body-temp-path=/dev/shm/nginx_temp/client_body --http-proxy-temp-path=/dev/shm/nginx_temp/proxy --http-fastcgi-temp-path=/dev/shm/nginx_temp/fastcgi --user=admin --group=admin --with-cpu-opt=pentium4F --without-select_module --without-poll_module --with-http_realip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --without-http_ssi_module --without-http_userid_module --without-http_ssi_module --without-http_userid_module --without-http_geo_module --without-http_map_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_proxy_module --with-stream

    make && make install 

    user  admin;
    #user root;
    worker_processes  8;
    error_log  /export/Logs/servers/nginx/logs/error.log warn;
    pid        /var/run/nginx.pid;
     
    events {
        worker_connections  1024;
    }
     
    http {
        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
        access_log  /export/Logs/servers/nginx/logs/access.log  main;
        sendfile        on;
        #tcp_nopush     on;
        keepalive_timeout  65;
        #gzip  on;
        include /etc/nginx/conf.d/*.conf;
    }
    stream{
            upstream mysql{
                   server 192.168.115.125:3358 weight=1;
                   
            }
            
            server{
                   listen 3358;
                   proxy_pass mysql;
            }
    }

    ------------------------------------------------------Tanwheey-------------------------------------------------------------------------

    爱生活,爱工作。

  • 相关阅读:
    Mysql性能优化之---(一)
    好好思考之(二)---介绍什么是思维模型,分析它的本质内涵
    好好思考-----概述(一)
    oracle 的安装 及环境的配置...
    数据结构中的树
    生成SSH秘钥连接github(详细教程)
    后端 SpringBoot + 前端 vue 打包发布到Tomcat
    vue 轮播图
    vue文字向上滚动
    数组去重
  • 原文地址:https://www.cnblogs.com/Tanwheey/p/12177063.html
Copyright © 2020-2023  润新知