0

I currently have an internal ALB (Not accessible to the world) with some microservices running. I now want the world to access certain microservices.

I would like to place a HAProxy cluster in front of my internal ALB that proxies the requests through it.

backend microservices
   reqrep ^([^\ :]*)\ /microservice/(.*) \1\ /\2

The above piece of config catches all the requests coming from hostnames that contain the word microservice. That seems to work. But how can I proxy them?

SnIpY
  • 123
  • 5

1 Answers1

0

You should have a look at some guides for HAProxy configuration files, it won't happen without it.

And once you do it, I think you should use a setup like this:

  • define haproxy ACLs

acl microservices_acl hdr_beg(host) -i microservices use_backend microsservices_backend if microservices_acl

  • backend

backend microservices_backend balance source hash-type consistent option httpclose server <FQDN of the server you need to proxy to> <ip address of that server>:80 check

There are sample haproxy configurations all over the Internet, check them!

13dimitar
  • 2,360
  • 1
  • 12
  • 15
  • And, don't forget that you need to enable and use the HAProxy asynchronous DNS `resolver` on each `server` line in the config, so that HAProxy can keep the IP address of the balancer current. They are not static. – Michael - sqlbot Feb 07 '18 at 15:12