Giter VIP home page Giter VIP logo

Comments (1)

BG2BKK avatar BG2BKK commented on August 16, 2024

你好
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.