lnmp添加nginx-sticky-module-1.1模块解决负载均衡会话保持问题。
2015-02-27 15:59
806 查看
1.模块下载地址及文档地址
https://code.google.com/p/nginx-sticky-module/downloads/list https://code.google.com/p/nginx-sticky-module/wiki/Documentation
2.进入nginx源码包编译
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 --add-module=/root/nginx-sticky-module-1.1
make && make install
3.配置
upstream tt.com {
sticky expires=1h;
server 192.168.0.50:82 weight=4 max_fails=3 fail_timeout=30s;
server 192.168.0.50:81 weight=4 max_fails=3 fail_timeout=30s;
}
server
{
listen 80;
server_name hh.com;
location / {
proxy_pass http://tt.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
https://code.google.com/p/nginx-sticky-module/downloads/list https://code.google.com/p/nginx-sticky-module/wiki/Documentation
2.进入nginx源码包编译
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 --add-module=/root/nginx-sticky-module-1.1
make && make install
3.配置
upstream tt.com {
sticky expires=1h;
server 192.168.0.50:82 weight=4 max_fails=3 fail_timeout=30s;
server 192.168.0.50:81 weight=4 max_fails=3 fail_timeout=30s;
}
server
{
listen 80;
server_name hh.com;
location / {
proxy_pass http://tt.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
相关文章推荐
- nginx添加sticky模块-cookie保持会话
- nginx第三方模块---nginx-sticky-module的使用(基于cookie的会话保持)
- nginx第三方模块---nginx-sticky-module的使用(基于cookie的会话保持)
- nginx会话保持之sticky模块
- nginx1.11.*版本追加安装sticky模块出现问题解决方法
- 基于lnmp 一键安装 添加 Nginx 的模块(module)
- 解决Nginx添加openssl模块编译时报错问题
- openssl安装问题导致nginx添加ssl模块失败
- 模块不能插入的问题解决 disagrees about version of symbol struct_module
- Nginx中解决惊群问题和负载均衡问题
- nginx 负载均衡 使用ip_hash方式解决session问题 测试
- nginx入门学习—— 在已安装好的nginx上添加nginx_upstream_check_module模块(三)
- nginx with secure_download 模块 出现worker process 20437 exited on signal 11的问题解决
- 负载均衡中用户的会话无法保持在一台机器上的问题!
- 解决nginx上传模块nginx_upload_module传递GET参数
- 模块不能插入的问题解决 disagrees about version of symbol struct_module
- 负载均衡常见问题之会话保持-粘滞会话(Sticky Sessions)
- Nginx 负载均衡模块 ngx_http_upstream_module 详述
- 在部署一个IIS7程序时的问题 模块列表中不存在为此处理程序指定的一个或多个模块。如果您尝试添加脚本 映射,则 IsapiModule 或 CgiModule 不会显示在模块列表中
- 解决:LNMP架构下nginx的error_log日志过大问题