0

I am using haproxy as a load balancer.

One of type incoming request use multipart/form-data( content type : application/pdf ).

This type of requests are not forwarded.

There is information in log:

qwerty qwerty/<NOSRV> 13/-1/-1/-1/13 500 208 - - PR-- 1/1/0/0/0 0/0 
{|Apache-HttpClient/4.5.5 (Java/12.0.1) 

Other requests ( content type: application/json ) are forwarded correctly

Haproxy 2.4.19

I try to add:

    acl multipart hdr_beg(Content-Type) -i multipart/form-data
    use_backend xyz if multipart

Without result.

Hproxy cfg:

    global

    #log 127.0.0.1 local0 debug - rsyslog logging
    log stdout len 65535 format raw local0 debug
    maxconn     4000
    stats socket :9000 mode 660 level admin
    lua-load /tmp/lua/haproxy_okapi_connector.lua    
    h1-case-adjust authorization Authorization
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
    mode                    http
    log                     global
    option                  dontlognull
    option                  httplog
    option                  http-buffer-request
    option                  forwardfor 
    retries                 3
    timeout http-request    90s
    timeout queue           2m
    timeout connect         90s
    timeout client          2m
    timeout server          2m
    timeout http-keep-alive 90s
    timeout check           90s
    maxconn                 30000

    
    #default log
    log-format              "%[src] %si:%sp %ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %[capture.req.hdr(1)] %[capture.req.hdr(2)] %[capture.req.hdr(3)] %[capture.req.hdr(4)] %[capture.req.hdr(5)]"
    

#---------------------------------------------------------------------
# Frontend with Headers 
#---------------------------------------------------------------------

frontend iwa-proxy
    bind *:8080
    http-request set-header X-Forwarded-Proto http
    http-request set-header forwarded "host=xxxx;proto=http;proto-version="
    http-request set-header x-forwarded-for xyz
    http-request set-header host xyz
    option h1-case-adjust-bogus-client
    http-request set-var(req.token)  str(""),lua.create_access_token
    http-request add-header "authorization" 'Bearer %[var(req.token)]'
    declare capture request len 800000
    declare capture response len 800000
    http-request capture req.body id 0
    http-response capture res.body id 0
    capture request header user-agent len 500
    capture request header Host len 500
    capture request header X-Forwarded-For len 500 
    capture request header X-Forwarded-Proto len 500 
    capture request header X-Forwarded-Host len 500 
    default_backend       xyz
    
#---------------------------------------------------------------------
# Backend
#---------------------------------------------------------------------  

backend iwa-ogate
    mode http
    balance roundrobin
    option forwardfor
    option h1-case-adjust-bogus-server
    server xyz xxx:443 ssl verify none
pr0g
  • 1
  • 1

0 Answers0