Nginx模块之SessionSticky
0 工作原理
1 下载 Session
Sticky
2 安装模块
-V 命令查看当时编译的参数。在参数后面追加安装 Session Sticky 模块的参数,
3 激活模块
Sticky模块。
4 可用选项
The "sticky" command can take several arguments to control its behaviour:
|
Configuration
|
Description
|
Parameters
|
Default Value
|
|
name
|
the name of the cookie used to track the persistant upstream srv
|
can be any string
|
"route"
|
|
domain
|
the domain in which the cookie will be valid
|
can be any string
|
nothing. Let the browser handle this.
|
|
path
|
the path in which the cookie will be valid
|
can be any path
|
nothing. Let the browser handle this.
|
|
expires
|
the validity duration of the cookie
|
must be a duration greater than one second
|
nothing. It's a session cookie
|
|
hash
|
the hash mechanism to encode upstream server. It cant' be used with hmac
|
md5|sha1
|
md5
|
|
hmac
|
The HMAC hash mechanism to encode upstream server. It's like the hash mechanism but it uses hmac_key to secure the hashing. It can't be used with hash.
|
md5|sha1
|
none
|
|
hmac_key
|
The key to use with hmac. It's mandatory when hmac is set.
|
can be any string
|
none
|
|
no_fallback
|
When this flag is set, nginx will return a 502 (Bad Gateway orProxy Error) if a request comes with a cookie and the corresponding backend is unavailable.
|
no arguments
|
none
|
参考资料
sticky 模块实现基于 cookie 的负载均衡
Nginx模块之SessionSticky的更多相关文章
- 结合源码看nginx-1.4.0之nginx模块组织结构详解
目录 0. 摘要 1. nginx模块组织结构 2. nginx模块数据结构 3. nginx模块初始化 4. 一个简单的http模块 5. 小结 6. 参考资料 0. 摘要 nginx有五大优点:模 ...
- 【转】Nginx模块开发入门
转自: http://kb.cnblogs.com/page/98352/ 结论:对Nginx模块开发入门做了一个helloworld的示例,简单易懂.也有一定的深度.值得一看. Nginx模块开发入 ...
- Nginx模块开发入门
前言 Nginx是当前最流行的HTTP Server之一,根据W3Techs的统计,目前世界排名(根据Alexa)前100万的网站中,Nginx的占有率为6.8%.与Apache相比,Nginx在高并 ...
- Nginx模块fastcgi_cache的几个注意点 转
Nginx模块fastcgi_cache的几个注意点 去年年底,我对nginx的fastcgi_cache进行摸索使用.在我的测试过程中,发现一些wiki以及网络上没被提到的注意点,这里分享一下. ...
- 开发Nginx模块
开发Nginx模块 前面的哪些话 关于Nginx模块开发的博客资料,网上很多,很多.但是,每篇博客都只提要点,无法"step by step"照着做,对于初次接触Nginx开发的同 ...
- [转] Nginx模块开发入门
前言 Nginx是当前最流行的HTTP Server之一,根据W3Techs的统计,目前世界排名(根据Alexa)前100万的网站中,Nginx的占有率为6.8%.与Apache相比,Nginx在高并 ...
- nginx模块开发获取post参数
> 您好!> 我想请问下nginx模块里面怎么获取post参数,能有具体的代码更好!谢谢> 对于 "application/x-www-form-urlencode ...
- Nginx模块开发入门(转)
前言 Nginx是当前最流行的HTTP Server之一,根据W3Techs的统计,目前世界排名(根据Alexa)前100万的网站中,Nginx的占有率为6.8%.与Apache相比,Nginx在高并 ...
- Nginx模块开发入门(转)
前言 Nginx是当前最流行的HTTP Server之一,根据W3Techs的统计,目前世界排名(根据Alexa)前100万的网站中,Nginx的占有率为6.8%.与Apache相比,Nginx在高并 ...
随机推荐
- bzoj 1925: [Sdoi2010]地精部落
Description 传说很久以前,大地上居住着一种神秘的生物:地精. 地精喜欢住在连绵不绝的山脉中.具体地说,一座长度为 N 的山脉 H可分 为从左到右的 N 段,每段有一个独一无二的高度 Hi, ...
- ubuntu Linux下C语言open函数打开或创建文件与read,write函数详细讲解
open(打开文件) 相关函数 read,write,fcntl,close,link,stat,umask,unlink,fopen 表头文件 #include<sys/types.h> ...
- jvm(三):对象
关于对象,我们需要面对的问题主要有对象的创建,对象在内存中的布局,对象的结构,对象的访问定位. 对象的创建 对象的创建过程如下图所示: 其主要步骤有:给对象分配内存,初始化对象,执行构造方法. 在对象 ...
- JAVA 访问WebRoot下的目录文件
转自 http://blog.csdn.net/jian_csdn/article/details/46119313 ClassLoader classLoader = Thread.currentT ...
- 在Spring Boot中使用Spring Security实现权限控制
丢代码地址 https://gitee.com/a247292980/spring-security 再丢pom.xml <properties> <project.build.so ...
- log4j不生成日志文件的问题
直接看我的注解吧 注意地址的斜杠,还有地址别写什么相对地址了,这包太老了,服务器update一下兼容问题就出来了. #第一个参数定义达到什么程度就输出 第二第三....第N 定义输出的类型 #debu ...
- leetcode刷题笔记08 字符串转整数 (atoi)
题目描述 实现 atoi,将字符串转为整数. 在找到第一个非空字符之前,需要移除掉字符串中的空格字符.如果第一个非空字符是正号或负号,选取该符号,并将其与后面尽可能多的连续的数字组合起来,这部分字符即 ...
- Go 语言教程
Go 语言教程 Go 是一个开源的编程语言,它能让构造简单.可靠且高效的软件变得容易. Go是从2007年末由Robert Griesemer, Rob Pike, Ken Thompson主持开发, ...
- Docker如何获取镜像
可以使用 docker pull 命令来从仓库获取所需要的镜像. 下面的例子将从 Docker Hub 仓库下载一个 Ubuntu 12.04 操作系统的镜像. $ sudo docker pull ...
- Android------Android.mk调用shell脚本
$(info $(shell ($(LOCAL_PATH)/echo_test.sh)))