V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
greatonce
V2EX  ›  程序员

如何根据参数转发请求?

  •  
  •   greatonce · Sep 12, 2017 · 2873 views
    This topic created in 3148 days ago, the information mentioned may be changed or developed.

    比如客户端请求

    http://host.com/?serverId=server1

    host.com 服务端可能是运行在 nginx,或 nodejs,或 python

    服务端这边获取到 serverId=server1,

    服务端会根据配置文件,得到 server1 的 ip:192.168.1.11 端口:2000

    怎么把这个请求转发给 ip:192.168.1.11 端口:2000

    而且在高并发请求的时候,还能保持高性能?

    4 replies    2017-09-13 16:00:29 +08:00
    greatonce
        2
    greatonce  
    OP
       Sep 12, 2017
    @qmm0523 谢谢,其实我想问的是,有没有什么方法能动态的处理,因为配置列表可能是随时更新的,如果写到 nginx 配置的话需要频繁更新
    orderc
        3
    orderc  
       Sep 13, 2017
    etcd+confd,动态更新 nginx 配置文件
    qmm0523
        4
    qmm0523  
       Sep 13, 2017
    @greatonce openresty 可以帮到你
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5302 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 01:17 · PVG 09:17 · LAX 18:17 · JFK 21:17
    ♥ Do have faith in what you're doing.