Comments (1)
你好
1 按照city分流是我们有一个业务,想按照城市来分流,分流时, 用户请求为GET请求(也可以自己写cityParser实现处理Post请求),请求参数中有一个是city.
所以说如何在request中设置用户特征呢,
可以在请求参数中,这样lua可以ngx.var.arg_VARIABLE获得信息,
可以在请求头部中,这样可以通过ngx.req.get_headers()[VARIABLE]
可以通过json解析POST数据, 这些都比较灵活.
2 IP信息直接从用户请求中提取, nginx有相应配置和功能. 值得说一下的是, 我们按照ip对用户分流时,并不是根据用户的具体ip来分流, 因为从server角度看, nginx获得用户请求ip是从某个运营商的出口,或者四七层接入设备中的, 只要知道用户请求从哪个运营商出来,这个运营商的ip就是我们的分流依据
from abtestinggateway.
Related Issues (20)
- 希望能做出集成的docker image HOT 1
- 【时好时坏】uidsuffix,新id第一次访问500,后面再刷新就正常 HOT 1
- 有编好的openresty-1.9.7.5吗? HOT 1
- 有好的交流群吗?有几个源码问题求解 HOT 1
- 如果并发量比较高,redis是否有压力?还有redis挂了的话,分流的使用受影响吗 HOT 3
- 修改了nginx和bate等文件的user为root了,lua文件增加了x权限,在curl时还是报404的错啊?
- 请问怎么调试正在运行的lua代码呢?各位都用的什么工具啊? HOT 2
- 开启编译缓存的情况下,会出现分流错误 HOT 2
- redis
- 这个项目还在维护么? HOT 1
- policy_set和policy_get规则不一致
- stop-all-nginx.sh无法停止abtesting.sh启动的进程?
- 为什么不增加一个基于cookie的分流策略呢?且为什么uid分流要求一定是数字 HOT 1
- bug:多级分流造成的 shdict key 名冲突 HOT 2
- 按照步骤部署完成后,运行
- 是不是已经停止维护了呢?
- How to use password to connect to redis HOT 2
- init_process_timer HOT 1
- 最近想使用这个网关,请问是用master好,还是v2.1好
- 如果要集成redis集群,那这个是否只需要替换redis相关就可以了 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abtestinggateway.