因为工作较忙,今天学习时间不长,主要做了

1 虚拟化另一台centos6.3 IP 134做前端nginx分发使用;

2 配置另外一台nginxweb服务器130.第一台是129.

134 nginx.conf的httpd节点配置如下

upstream www.test1.com {
       server 192.168.65.129:80;
       server 192.168.65.130:80;
    }

在这里默认的情况是轮询算法

要解决session问题,计划后面用ip_hash 和url_hash做下实验!

具体域名配置在server中

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;

        proxy_pass  http://www.test1.com;
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    }

增加proxy_xxx项。

 

遇到的问题。我在实体机上无法访问虚拟机站点

(已绑定host ,等)不知道为什么?

所以要想实现分发还需要解决这个问题!

【问题解决:是防火墙的问题】

一下三段命令

service iptables stop

chkconfig iptables off

setenforce 0

 

 

今天学习毕。明天继续!

 

 

 

相关文章:

  • 2021-11-23
  • 2021-11-23
  • 2021-05-23
  • 2022-12-23
  • 2021-04-04
猜你喜欢
  • 2022-12-23
  • 2021-06-24
  • 2021-04-12
  • 2021-03-31
  • 2021-04-11
  • 2021-11-23
相关资源
相似解决方案