My bad, I was testing it on wrong instance.

tcp-request content set-dst-port int(80)

is working fine :-)


Best Regards,
Andrei Kvapil


On Thu, Oct 19, 2023 at 8:06 PM kvaps <kva...@gmail.com> wrote:

> Hi,
>
> I run haproxy in non-privileged container, so I can't bind on higher port
> eg 80 and 443
> Thus I binded it to 8080 and 8443.
>
> But kubernetes service listening on normal port: 80 and 443
>
> I use tcp mode with proxy protocol (send-proxy-v2) to preserve the
> client's real IP and port.
> On the backend server I see that requests are expanded to:
>
> X-Forwarded-Port: 8080 and X-Forwarded-Port: 8433
>
> How can I override them to 80 and 443 in haproxy configuration?
>
> I tried setting the following options to frontend section:
>
> http-request set-header X-Forwarded-Port int(80)
> tcp-request content set-dst-port int(80)
> tcp-request connection set-dst-port int(80)
>
> None of them didn't make an effect :(
>
> Best Regards,
> Andrei Kvapil
>

Reply via email to