Haproxy无法识别请求标头

问题描述 投票:1回答:1

通过HAProxy传递的请求标头,但是hdr()req.hdr()或任何相关函数虽然将请求标头传递到目标服务器,但无法识别任何请求标头。

我的前端配置如下,使用http模式:

acl xip req.hdr(x-real-ip) -m found 
use_backend first-half if xip

不起作用!尽管存在此标头。

NB:仅检测到req(host)

haproxy
1个回答
0
投票

您需要使用“ X-Forwarded-For”代替“ x-real-ip”。

© www.soinside.com 2019 - 2024. All rights reserved.