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在高并 ...
随机推荐
- HDU 5506(GT and set)
题意: 表示看了很久,然而发现还是没看懂题. 正解:给你a个集合,让你把他们合并成k个,当两个集合有公共数字时可以合并. (一直以为是合并后,每个集合至少有两个数字相同- -,这英语也是醉了) 思路: ...
- hdu 1754 线段树(Max+单点修改)
I Hate It Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- centos7安装nginx必要环境
安装所需环境 Nginx 是 C语言 开发,建议在 Linux 上运行 , 在安装nginx前还要安装以下的环境包 一. gcc 安装安装 nginx 需要先将官网下载的源码进行编译,编译依赖 gcc ...
- UDA机器学习基础—误差原因
1.模型误差产生的原因 (1)模型无法表示基本数据的复杂度,而造成偏差. (2)因模型对训练它所用到的数据过度敏感造成的方差. 2.由偏差造成的误差--准确率和欠拟合 有足够数据表示模型,但是由于模型 ...
- Python中模块之collections系列
collection系列功能介绍 1. 常用的集中类 1. Counter(计数器) 计数器的常用方法如下: 创建一个字典计数器 格式:collections.Counter(obj) 例如:prin ...
- 在浏览器中运行Keras模型,并支持GPU
Keras.js 推荐一下网页上的 demo https://transcranial.github.io/keras-js/#/ 加载的比较慢,但是识别的非常快. Run Keras models ...
- python2.7练习小例子(一)
1)题目:有四个数字:1.2.3.4,能组成多少个互不相同且无重复数字的三位数?各是多少? 程序分析:可填在百位.十位.个位的数字都是1.2.3.4.组成所有的排列后再去掉不满足条件的 ...
- 操作系统内存管理之 内部碎片vs外部碎片
外部碎片:因为行程持续地被载入与置换,使得可用的记忆体空间被分割成许多不连续的区块.虽然记忆体所剩空间总和足够让新行程执行,却因为空间不连续,导致程式无法载入执行.内部碎片:发生在以固定长度分割区来进 ...
- SQL Server用户自定义数据类型
用户自定义数据类型:基于系统数据类型,由数据库管理员生成.利用系统存储过程定义用户自定义数据类型` Sp_addtype [@typename=] 新数据类型名, [@phystype=] 系统数据类 ...
- Python中切片的工作原理
切片时的索引是在两个字符之间.左边第一个字符的索引为 0,而长度为 n 的字符串其最后一个字符的右界索引为n. 例如: +---+---+---+---+---+---+ | P | y | t | ...