awanganddong

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

  •  
  •   awanganddong · Jul 22, 2024 · 3466 views
    This topic created in 837 days ago, the information mentioned may be changed or developed.

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

    9 replies  •  2024-07-23 10:05:07 +08:00
    K2K2
    K2K2
    Jul 22, 2024
    1
    X-Forwarded-For 参考链接: https://blog.bitipcman.com/eks-elb-get-real-ip/
    K2K2
    K2K2
    Jul 22, 2024
    2
    awanganddong
    awanganddong
    OP
    Jul 22, 2024
    3
    我看了这些帖子和我要的感觉不太一样。最主要问题在于我在 elb 之前又加了一个 nginx 当作负载均衡。
    awanganddong
    awanganddong
    OP
    Jul 22, 2024
    5
    公司之前买的 https 证书是从小公司来的,我导入 aws 之后,https ios 不能用。要改中间证书,比较麻烦
    ninion
    ninion
    Jul 22, 2024
    6
    aws elb 产品线有多个 lb 产品,如果使用的是 alb 或者 clb 可以直接用 X-Forwarded-For 捕获 Client IP ,如果使用的是 nlb 需要在目标组参数中开启 Client IP preservation
    daimaosix
    daimaosix
    Jul 22, 2024
    7
    是 Global 还是 CN ?
    clhlc
    clhlc
    Jul 22, 2024
    8
    @awanganddong 证书用 aws 的 acm
    awanganddong
    awanganddong
    OP
    Jul 23, 2024
    9
    我还是直接用回 aws ,不然太麻烦。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2272 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 11:58 · PVG 19:58 · LAX 03:58 · JFK 06:58
    ♥ Do have faith in what you're doing.