負載均衡7層nginx(提供軟體包)
負載均衡7層Nginx(提供軟體包)
Nginx proxy 利用 proxy 基本可以實現一個完整的 7 層負載均衡。
Client eth0: 192.168.122.1/24
Nginx eth0:192.168.122.254/24
HTML 1 eth0 192.168.122.10/24
HTML 2 eth0 192.168.122.20/24
PHP 1 eth0 192.168.122.30/24
PHP 2 eth0 192.168.122.40/24
HTML 1和2
# yum install httpd
分別建立測試頁面index.html ,開啟服務
PHP 1和2
# yum install httpd
分別建立測試頁面index.php ,開啟服務
安裝配置Nginx
# rpm -ivh nginx-0.6.36-1.el5.i386.rpm
# vim /etc/nginx/nginx.conf
location/ {
root/usr/share/nginx/html;
indexindex.html index.htm;
if($request_uri ~* .html$) {
proxy_passhttp://htmlserver;
}
if($request_uri ~* .php$) {
proxy_passhttp://phpserver;
}
}
# vim /etc/nginx/conf.d/test.conf
upstream htmlserver {
server192.168.122.10;
server192.168.122.20;
}
upstream phpserver {
server192.168.122.30;
server192.168.122.40;
}
# service nginx start
在客戶端訪問 HAproxy測試
# elinks –dump http:// 192.168.122.254
# elinks –dump http://192.168.122.254/index.html
# elinks –dump http://192.168.122.254/index.php
可以只做2個html進行測試訪問192.168.122.254/index.html 不停地重新整理清楚歷史記錄會分別看到html 1和2 的網頁
軟體包看其他博文最下面的百度雲盤的地址
相關文章
- HAProxy 7層 負載均衡負載
- Nginx如何實現四層負載均衡?Nginx負載
- NGINX 負載均衡Nginx負載
- 【Nginx】負載均衡Nginx負載
- nginx負載均衡Nginx負載
- 【知識分享】四層負載均衡和七層負載均衡負載
- Nginx負載均衡模式Nginx負載模式
- Nginx--負載均衡Nginx負載
- nginx 負載均衡搭建Nginx負載
- Nginx負載均衡策略Nginx負載
- 解析 Nginx 負載均衡Nginx負載
- 基於Nginx的軟體負載均衡實現解讀Nginx負載
- Nginx、LVS、HAProxy負載均衡軟體的優缺點Nginx負載
- Nginx負載均衡詳解Nginx負載
- Nginx負載均衡高可用Nginx負載
- nginx實現負載均衡Nginx負載
- 【Nginx】面試官:給我講講Nginx如何實現四層負載均衡?Nginx面試負載
- 【Nginx】Nginx反向代理和負載均衡部署Nginx負載
- Nginx服務系列——負載均衡Nginx負載
- 使用Nginx配置TCP負載均衡NginxTCP負載
- nginx學習之負載均衡Nginx負載
- 使用nginx進行負載均衡Nginx負載
- 使用nginx負載均衡nodejsNginx負載NodeJS
- Nginx 負載均衡原理解讀Nginx負載
- [Open Source] 負載均衡之Nginx負載Nginx
- Nginx負載均衡配置說明Nginx負載
- Nginx + IIS 實現負載均衡Nginx負載
- 四層/七層負載均衡裝置(-)負載
- linux負載均衡總結性說明(四層負載/七層負載)Linux負載
- Nginx/LVS/HAProxy負載均衡軟體的優缺點詳解Nginx負載
- Nginx/LVS/HAProxy 負載均衡軟體的優缺點詳解Nginx負載
- centos7下配置nginx反向代理負載均衡叢集CentOSNginx負載
- 基於滴滴雲部署 HAProxy 實現 7 層和 4 層負載均衡負載
- 012.Nginx負載均衡Nginx負載
- Nginx/Httpd負載均衡tomcat配置Nginxhttpd負載Tomcat
- Nginx多種負載均衡策略搭建Nginx負載
- Nginx 學習系列(二) ------------- 負載均衡Nginx負載
- Nginx 學習系列(二) ————- 負載均衡Nginx負載