Haproxy on kubernetes send requests to https backend

Hello,

We have Haproxy deployed to k8s cluster with helm. Haproxy version is 2.9.2

We are trying to send requests to some public https url backend , this is the haproxy config we use.


global
  log stdout format raw local0

defaults
  log global
  timeout client 120s
  timeout connect 120s
  timeout server 120s

frontend frontend1
  bind *:10443
  mode http
  default_backend backend1

backend backend1
  mode http
  server backendserver1 <example.com>


We port-forward to Haproxy service on port 10433 and send request to localhost:10433 via Postman, the request url is something like that

http://localhost:10433/some/path

So, what we want to achieve when we send the request from localhost we expect it to reach https://example.com/some/path but we have no luck, it just get 408 Request Time-out. How can we achieve this kind of routing.

I am new to Haproxy so, thank you in advance.

Hello,

try defining server backends like: server backendserver <example.com>:443 ssl. HAProxy is unable to detect if backend server is HTTP or HTTPS, you have to configure it.

Hi Dragonn,

I changed the config like you said and add the ssl verify none but when i send request i get 503 Service Unavailable, No server is available to handle this request.

Is there anything need to change in the config?

Thank you for your help