zoukankan      html  css  js  c++  java
  • Nginx负载均衡配置

    (1)关键配置信息

    (2)配置文件

    worker_processes  1;
    
    events {
        worker_connections  1024;
    }
    http {
        include       mime.types;
        default_type  application/octet-stream;
    
        sendfile        on;
        keepalive_timeout  65;
    
        upstream article {
            server 192.168.11.3:8089;
            server 192.168.11.3:8088 ;
        }
        server {
            listen       80;
            server_name  localhost;
    
            location / {
              #  root   html;
               # index  index.html index.htm;
                add_header 'Access-Control-Allow-Origin' '*';
                proxy_pass http://article;
            }
            
            location /xmkkj {
                include  uwsgi_params;
                proxy_pass   http://192.168.11.3:8082;
           }
           
            location /xmkj {
                include  uwsgi_params;
                proxy_pass   http://192.168.11.3:8084;
           }
            
            location /xmkj2 {
                include  uwsgi_params;
                proxy_pass   http://192.168.11.3:8084;
           }
            
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
    
        }
    
    
    }

    (3)效果

    通过访问:http://192.168.11.3:80/article/

    可以访问到:http://192.168.11.3:8088/article/,http://192.168.11.3:8089/article/

  • 相关阅读:
    数据持久化的基础知识
    svn常用命令
    关于SVN 目录结构
    linux查看CPU信息
    一个服务器上启动两台tomcat
    centos6.0 配置SVN
    mysql插入表情
    MAC 安装 PIL
    安装freetype
    Hadoop基本文件命令
  • 原文地址:https://www.cnblogs.com/excellencesy/p/11949736.html
Copyright © 2011-2022 走看看