• 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-------------------------------------------------------------------------

    爱生活,爱工作。

  • 相关阅读:
    第四百零三节,python网站在线支付,支付宝接口集成与远程调试,
    第四百零二节,Django+Xadmin打造上线标准的在线教育平台—生产环境部署,uwsgi安装和启动,nginx的安装与启动,uwsgi与nginx的配置文件+虚拟主机配置
    第四百节,Django+Xadmin打造上线标准的在线教育平台—生产环境部署CentOS6.5安装python3.5.1
    第四百零一节,Django+Xadmin打造上线标准的在线教育平台—生产环境部署virtualenv虚拟环境安装,与Python虚拟环境批量安装模块
    中间件
    django自定义分页器组件
    Form组件
    前端之CSS重点知识
    group by 和where
    关于update和alter
  • 原文地址:https://www.cnblogs.com/Tanwheey/p/12177063.html
Copyright © 2020-2023  润新知