原文地址:
1.下载nginx
cd /usr/local/src/
wget
2.下载 NginxHttpUpstreamRequestHashModule
3.安装
1.)tar xzf nginx-0.7.64.tar.gz
2.)tar xzf Nginx_upstream_hash-0.3.1.tar.gz
3.)cd nginx-0.7.64
4.)patch -p0 < /usr/local/src/nginx_upstream_hash-0.3.1/nginx.patch
5.)./configure --with-http_ssl_module --with-http_gzip_static_module --with-http_dav_module --with-http_realip_module --with-http_stub_status_module --prefix=/usr/local/httpd/ --add-module=/usr/local/src/nginx_upstream_hash-0.3.1/
4.配置
backend {
server1;
server2;
hash $request_uri;
}
或者:
backend {
server1;
server2;
hash hash $http_cookie;
}
阅读(1643) | 评论(0) | 转发(0) |