Score:0

HAproxy as fowarding server?

cn flag
sgt

I am trying to forward requests, locally to haproxy. I cant seem to get it working, I have a script which calls this end point every n sec, and even though i have it set on etc/hosts it doesn't get routed via haproxy ? I do this routing inspecting SNI and applying an acl for the respective backend.

I set on etc/hosts:

127.0.0.2 example.com

Defaults:

defaults
    log  global
    mode    tcp
    option  tcplog

I then have a this defined as Frontend:

frontend default
    log  global
    mode    tcp
    option  tcplog
    bind *:443
    tcp-request inspect-delay 1s
    tcp-request content accept if { req_ssl_hello_type 1 }


    acl example_us req_ssl_sni -i example.com 
    use_backend example_us if example_us

Resolvers:

resolvers mynameservers
    nameserver ns1 8.8.8.8:53

Backend:

backend example_us
    option external-check  
    external-check command /usr/local/bin/healthcheck 
    server s1 example.com:443 check inter 1m resolvers mynameservers fall 5 rise 1 resolve-prefer ipv4

I have add resolver so i could pick up example.com ip via 8.8.8.8, but locally i would have it forwarding to a loopback interface.

I was looking to do example.com -> localhost:443 -> haproxy -> example.com

Is this possible ? i am having trouble figuring this out

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.