美文网首页
负载均衡设置

负载均衡设置

作者: 路过的人儿 | 来源:发表于2017-12-09 20:12 被阅读0次

在需要被负载均衡的域名配置信息中添加

server {
        server_name "docker.mqphp.com";
        listen 80;

        location / {
            proxy_pass http://tomcat_back;
            proxy_redirect default;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }
    }

在nginx.conf中进行设置

#gzip  on;
    upstream test{
      #ip_hash; 
      server localhost:8280;
      server localhost:8180;
      server zz.longqine.com;
    }
    upstream tomcat_back {
         server docker.mqphp.com:8080 weight=1;
    }

相关文章

网友评论

      本文标题:负载均衡设置

      本文链接:https://www.haomeiwen.com/subject/uaypixtx.html