File tree Expand file tree Collapse file tree
custom-domain/dstack-ingress/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,14 +156,16 @@ EOF
156156 cat << 'EVIDENCE_BLOCK ' >>/etc/haproxy/haproxy.cfg
157157
158158 # Route /evidences requests to the local evidence HTTP server.
159- # inspect-delay sets the upper bound for buffering; the accept rule
160- # fires as soon as any application data is present in the buffer
161- # (after SSL termination a full TLS record is decrypted atomically,
162- # so the complete HTTP request is available on first evaluation).
159+ # accept fires once 16 bytes have arrived — enough for the
160+ # longest prefix we match ("HEAD /evidences" = 16 chars).
161+ # Using req.len with a concrete threshold is critical: the
162+ # previous payload(0,0) (length 0 = "whole buffer") deferred
163+ # evaluation until the full inspect-delay because HAProxy
164+ # cannot know when a TCP stream ends.
163165 tcp-request inspect-delay 5s
164- tcp-request content accept if { req.len gt 0 }
165- acl is_evidence payload(0,0 ) -m beg "GET /evidences"
166- acl is_evidence payload(0,0 ) -m beg "HEAD /evidences"
166+ tcp-request content accept if { req.len ge 16 }
167+ acl is_evidence payload(0,16 ) -m beg "GET /evidences"
168+ acl is_evidence payload(0,16 ) -m beg "HEAD /evidences"
167169 use_backend be_evidence if is_evidence
168170EVIDENCE_BLOCK
169171 fi
You can’t perform that action at this time.
0 commit comments