搜索

首页  >  问答  >  正文

haproxy 如何获取nginx传来的用户真实ip?

架构模式是 nginx -> haproxy -> apache

haproxy 如何获取nginx 传递过来的真实ip?

过去多啦不再A梦过去多啦不再A梦2860 天前1136

全部回复(2)我来回复

  • 淡淡烟草味

    淡淡烟草味2017-05-16 17:30:13

    当然是nginx增加一个字段到http request header里,把真实地址forward到后端去。想啥呢啊。

    回复
    0
  • 仅有的幸福

    仅有的幸福2017-05-16 17:30:13

    很简单啊 配置选项中 添加如下命令即可
    option forwardfor except 127.0.0.1

    回复
    0
  • 取消回复