Port Lost on frontend with 302 redirect

Hi all.

I’m trying to proxy an internal server with OWA installed.

this is my haproxy config

global

  • set-dumpable*

  • user nobody*

  • group nogroup*

  • log stdout local0*

  • strict-limits*

  • h1-case-adjust cache-control CaChE-CoNtRoL*
    defaults

  • mode http*

  • log 127.0.0.1:514 local0*

  • timeout client 5s*

  • timeout server 5s*

  • timeout connect 5s*

  • option redispatch*

  • option httplog*

  • SlowLoris Attack*

  • timeout http-request 5s*

  • option http-buffer-request*

frontend owa_frontend

  • bind :8400 ssl crt /opt/certs/Owa.pem ssl-min-ver TLSv1.1 *
  • option forwardfor*
  • http-request add-header X-Forwarded-Proto https if { ssl_fc }*
  • mode http*
  • default_backend be_main_10000*

backend be_main_10000

  • retry-on all-retryable-errors*
  • retries 3*
  • option forwardfor*
  • http-request add-header X-Forwarded-Port %[dst_port]*
  • http-request add-header X-Forwarded-Proto https if { ssl_fc }*
  • server server_10000 192.168.10.10:443 ssl verify none*

The frontend listens on 192.168.10.9:8400 and the Exchange OWA listens on 192.168.10.10:443
When I acces to my haproxy instance “https://192.168.10.9:8400/owa” I loose the port on the frontend

Ex:

curl -ikv https://192.168.10.9:8400/owa

------ (cut a lot of stuff) -----
Object moved to href=“https://192.168.10.9/owa/auth/logon.aspx?url=https%3A%2F%2F192.168.10.9%2Fowa&reason=0”>

The port is lost, so I cannot access (I have to manually put the “:8400” to get it work).
Is it possible to “force” that 302 redirection to not affect the URL ?

Thanks !