Skip to content

Instantly share code, notes, and snippets.

@yangl
Last active January 12, 2017 03:42
Show Gist options
  • Save yangl/df050c346f187b95625b to your computer and use it in GitHub Desktop.
Save yangl/df050c346f187b95625b to your computer and use it in GitHub Desktop.
nginx-sticky-module使用说明
1.cd $NGINX_HOME,执行./sbin/nginx -V 查看安装参数;
2.得到安装参数后,添加nginx-sticky-module模块重新编译nginx,
./configure "之前的参数" --add-module=/nginx-sticky-module下载所在目录/nginx-sticky-module
make && make install
3.在upsteam中添加如下:
sticky name=srv_id expires=1h domain=uxin.com path=/;
4.nginx reload测试查看是否有效果
参见:
https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/overview
http://nginx.org/en/docs/http/ngx_http_upstream_module.html#sticky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment