### HttpIndex模块
这个模块提供一个简单方法来实现在轮询和客户端IP之间的后端服务器负荷平衡。
配置范例:
~~~
upstream backend {
server backend1.example.com weight=5;
server backend2.example.com:8080;
server unix:/tmp/backend3;
}
server {
location / {
proxy_pass http://backend;
}
}
~~~
配置指导
### ip_hash
syntax: ip_hash
default: none
context: upstream
This directive causes requests to be distributed between upstreams based on the IP-address of the client. The key for the hash is the class-C network address of the client. This method guarantees that the client request will always be transferred to the same server. But if this server is considered inoperative, then the request of this client will be transferred to another server. This gives a high probability clients will always connect to the same server.
范例:
~~~
upstream backend {
ip_hash;
server backend1.example.com;
server backend2.example.com;
server backend3.example.com down;
server backend4.example.com;
}
~~~
### server
syntax: server name [parameters]
default: none
context: upstream
- 主要文档
- Nginx功能概述
- 为什么选择Nginx
- Nginx安装
- 运行和控制Nginx
- 配置符号参考
- 优化 Nginx
- 常见问题(FAQ)
- 调试 nginx
- 核心模块
- Nginx主模块
- Nginx事件模块
- 基本模块
- http核心模块
- HttpIndex模块
- HttpAccess模块
- HttpAuthBasic模块
- HttpAutoindex模块
- Browser模块
- Charset模块
- HttpEmptyGif模块
- HttpFcgi模块
- Geo模块
- HttpGzip模块
- HttpHeaders模块
- HttpIndex模块
- HttpReferer模块
- HttpLimit zone
- HttpLimitReqest模块
- HttpLog模块
- map
- Memcached
- HttpProxy模块
- HttpRewrite模块
- HttpSSI模块
- HttpUserId
- 其他模块
- Addition模块
- EmbeddedPerl
- flv
- HttpGzipStatic
- RandomIndex
- HttpGeoIP
- HttpRealIp
- HttpSSL
- StubStatus模块
- HttpSubstitution
- HttpDav模块
- GooglePerftools
- HttpXSLT
- HttpSecureLink
- HttpImageFilter
- mail模块
- MailCore
- MailAuth
- MailProxy
- MailSSL
- 安装
- nginx在windows上的安装
- nginx在freebsd上的安装
- nginx在ubuntu上的安装
- nginx在fedora上的安装
- nginx php-fpm安装配置
- 配置示例和方法
- 完整例子
- 完整例子2
- 虚拟主机
- 负载均衡
- nginx防盗链
- HWLoadbalancerCheckErrors