Nginx简单的负载均衡入门
2016-04-29 14:06
465 查看
nginx是用来管理tomcat的,只管理tomcat,并没有管理具体tomcat里面的项目,这里实现了简单的nginx管理两个tomcat的配置,注意upstream节点应该配置到service节点外面来
参考链接:http://cxshun.iteye.com/blog/1535188
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; #服务器的集群 upstream demo1.com{ #服务器集群的名字 #server 192.168.3.43 weight=1; #服务器配置,weight是权重的意思,权重越大,分配的概率越大 server 127.0.0.1:8081 weight=1; server 127.0.0.1:8082 weight=2; } server { listen 80; server_name location; #server_name 192.168.160.128; #当前服务的域名,这里就用当前服务器的ip地址, #域名可以有多个,用空格隔开:例如 server_name www.ha97.com ha97.com; #请求转向自定义的服务器列表 location / { proxy_pass http://demo1.com; proxy_redirect default; } } }
参考链接:http://cxshun.iteye.com/blog/1535188
相关文章推荐
- nginx安装与配置
- Nginx日志文件的切割
- Nginx实战配置详解案例
- linux中nginx的安装,linux的版本是ubutu
- 如何搞定前端资源服务跨域问题之nginx篇
- nginx proxy的使用
- Nginx部署ThinkPHP项目的办法
- [ngix]CentOS6 下nginx的安装
- ubuntu安装nginx及负载均衡配置
- Nginx教程(三) Nginx日志管理
- nginx配置缓存
- 构建高效安全的Nginx Web服务器
- nginx1.8.0和php7.0.4编译安装脚本
- Linux下搭建Nginx+heartbeat
- php+nginx 上传大文件要修改的配置
- php+nginx 上传文件大小限制要修改的文件
- nginx 解决首页跳转问题
- Nginx Permission denied
- Configuring Locations(配置locations)
- centos7 安装 nginx