Haproxy不捕获添加的标题

我可以通过“http response add-header”函数在haproxy中添加新的头文件,并且成功完成了,因为当我使用Wireshark的时候,我可以在HTTP数据包中看到添加的头文件。

问题是我无法捕捉它们。 我使用“捕获响应头”function,我可以捕获和logging像“内容types”或“连接”的常见头,但它不适用于添加标头。

这是我的conf文件haproxy.cfg:

global log /dev/log local0 log /dev/log local1 notice chroot /var/lib/haproxy stats socket /run/haproxy/admin.sock mode 660 level admin stats timeout 30s user haproxy group haproxy daemon defaults log global mode http option httplog option dontlognull option http-server-close timeout http-request 5000 timeout connect 5000 timeout client 50000 timeout server 50000 frontend localnodes bind 10.0.0.16:80 mode http # Table definition stick-table type ip size 100k expire 30s store conn_cur tcp-request connection track-sc1 src capture response header X-Test-One len 10 capture response header X-Test-Two len 10 capture response header Content-Type len 10 capture response header Connection len 10 default_backend nodes backend nodes mode http balance roundrobin http-response add-header X-Test-One %Ts http-response add-header X-Test-Two %T server web01 123.123.22.22:2222 check maxconn 500 listen stats *:1936 stats enable stats uri / stats hide-version stats auth notthelogin:notthepassword 

而当我使http请求在我的日志文件中有这个:

 Oct 7 11:12:38 localhost haproxy[20304]: 10.0.0.20:34316 [07/Oct /2015:11:12:38.972] localnodes nodes/web01 0/0/0/1/1 200 11378 - - ---- 14/14/0/0/0 0/0 {||text/html|close} "GET / HTTP/1.0" 

在日志中,我们可以清楚地看到“{|| text / html | close}”标准头文件很好捕获,而不是在“|”之间显示为空的2个头文件。 但是我们可以通过wireshark查看http包中的信息

显示自定义标题的Wireshark屏幕截图

有人可以帮我吗? 我找不到有什么问题,因为两天之后我就在这里:/

谢谢 :)