V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
awanganddong
V2EX  ›  Amazon Web Services

aws elb 负载均衡如何获取用户真实 ip

  •  
  •   awanganddong · 56 天前 · 1431 次点击
    这是一个创建于 56 天前的主题,其中的信息可能已经有所发展或是发生改变。

    公司项目最近新加了一个 elb,但是在 elb 之前还有一个 nginx ,这样导致 elb 获取的 ip 属于 nginx 的 ip 。 怎么才能让 elb 获取的客户端 ip 是客户端的真实 ip ?

    9 条回复    2024-07-23 10:05:07 +08:00
    K2K2
        1
    K2K2  
       56 天前
    X-Forwarded-For 参考链接: https://blog.bitipcman.com/eks-elb-get-real-ip/
    K2K2
        2
    K2K2  
       56 天前
    awanganddong
        3
    awanganddong  
    OP
       56 天前
    我看了这些帖子和我要的感觉不太一样。最主要问题在于我在 elb 之前又加了一个 nginx 当作负载均衡。
    enchilada2020
        4
    enchilada2020  
       56 天前 via Android
    awanganddong
        5
    awanganddong  
    OP
       56 天前
    公司之前买的 https 证书是从小公司来的,我导入 aws 之后,https ios 不能用。要改中间证书,比较麻烦
    ninion
        6
    ninion  
       56 天前
    aws elb 产品线有多个 lb 产品,如果使用的是 alb 或者 clb 可以直接用 X-Forwarded-For 捕获 Client IP ,如果使用的是 nlb 需要在目标组参数中开启 Client IP preservation
    daimaosix
        7
    daimaosix  
       56 天前
    是 Global 还是 CN ?
    clhlc
        8
    clhlc  
       56 天前
    @awanganddong 证书用 aws 的 acm
    awanganddong
        9
    awanganddong  
    OP
       55 天前
    我还是直接用回 aws ,不然太麻烦。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   954 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 19:41 · PVG 03:41 · LAX 12:41 · JFK 15:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.