Haproxy는 추가된 헤더를 캡처하지 않습니다.

Haproxy는 추가된 헤더를 캡처하지 않습니다.

"http 응답 추가 헤더" 기능을 사용하여 haproxy에 새 헤더를 추가할 수 있으며 Wireshark를 사용할 때 http 패킷에 추가된 헤더를 볼 수 있기 때문에 성공적으로 완료되었습니다.

문제는 내가 그들을 포착할 수 없다는 것이다. "응답 헤더 캡처" 기능을 사용하면 "Content-Type" 또는 "Connection"과 같은 일반 헤더를 캡처하고 기록할 수 있지만 추가된 헤더에서는 작동하지 않습니다.

이것은 내 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 스크린샷

나를 도와줄 수 있는 사람이 있나요? 나는 문제가 무엇인지 알 수 없으며 이틀 이후로 계속 이 문제를 겪고 있습니다.

감사합니다 :)

관련 정보