nginx反向代理負載均衡
1.反向代理概述
反向代理(Reverse Proxy)方式是指以代理服務器來接受internet上的連接請求,然後將請求轉發給內部網絡上的服務器,並將從服務器上得到的結果返回給internet上請求連接的客戶端,此時代理服務器對外就表現為一個反向代理服務器。
環境準備:
主機名 | IP地址 | 角色 | 系統 |
---|---|---|---|
web-node1.com | eth0:192.168.90.201 | web-node1節點 | CentOS7.2 |
web-node2.com | eth0:192.168.90.202 | web-node2節點 | CentOS7.2 |
lb-node1.com | eth0:192.168.90.203 | Nginx反向代理 | CentOS7.2 |
2.Node節點部署
在兩臺web-node節點中均使用Yum安裝一個Apache用於做真實機,監聽8080端口
web-node1.com部署
[[email protected] ~]# rpm -ivh http://mirrors.aliyun.com/epel/epel-release-latest-7.noarch.rpm [[email protected] ~]# yum install -y gcc glibc gcc-c++ make screen tree lrzsz ##部署web-node1 httpd服務 [[email protected] ~]# yum install -y httpd [[email protected]
web-node2.com部署
[[email protected]