nginx 负载均衡
2015-07-29 17:47
656 查看
操作环境
nginx 服务器[root@nginx ~]# cat /etc/redhat-release CentOS release 6.5 (Final)
web 服务器 1
[root@web ~]# cat /etc/redhat-release CentOS release 6.5 (Final)
web 服务器 2
[root@web-2 ~]# cat /etc/redhat-release CentOS release 6.5 (Final)
web 服务器 页面 1
web 服务器 页面 2
nginx 服务器配置
nginx配置[root@nginx ~]# vi /etc/nginx/nginx.conf
# 负载均衡测试 upstream webservers { server 123.59.74.187 weight=1; server 123.59.75.157 weight=1; } # 反向代理测试 server { listen 2000; location / { proxy_pass http://webservers; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } }
重新加载nginx配置
[root@nginx ~]# nginx -s reload
访问nginx服务器地址 2000端口 两个页面交替出现
页面 1
页面 2
相关文章推荐
- nginx代理指定目录
- 访问Nginx发生SSL connection error的一种情况
- Nginx+Naxsi部署专业级Web应用防火墙
- CentOS 6.2实战部署Nginx+MySQL+PHP
- 负载均衡技术沙龙1期(关于咱的图片)
- 负载均衡沙龙活动第二期现场问答汇集
- 网站502与504错误分析
- 艰难完成 nginx + puma 部署 rails 4的详细记录
- 把Lua编译进nginx步骤方法
- 浅谈sqlserver的负载均衡问题
- web 应用中常用的各种 cache详解
- window+nginx+php环境配置 附配置搭配说明
- PHP开发负载均衡指南
- Win2003利用dfs(分布式文件系统)在负载均衡下的文件同步配置方案
- LVS+Keepalived构建高可用负载均衡(测试篇)
- 解析CI即CodeIgniter框架在Nginx下的重写规则
- 简单测试Apache是如何完成负载均衡策略配置
- Apache负载均衡设置方法 mod_proxy使用介绍
- LVS(Linux Virtual Server)Linux 虚拟服务器介绍及配置(负载均衡系统)