Re: Performing URL rewriting and re-resolving new URL using configured DNS

2020-09-11 Thread francis Lavalliere
Hello,

Haproxy is a great tool indeed. And as long as you are able to add some dynamic 
template generation of haproxy config based on your own business logic I 
believe you should be good.

You could leverage consul / consul-template and have the haproxy regenerates 
bases on your business logic.

We do use that combination and it works quite well for us.

Regards
Francis L.

Téléchargez Outlook pour Android<https://aka.ms/ghei36>


From: Yehuda Cohen 
Sent: Friday, September 11, 2020 11:32:51 AM
To: haproxy@formilux.org 
Subject: Performing URL rewriting and re-resolving new URL using configured DNS


Hi all,



Hoping you can help me with this query. I have a selection of micro-backends 
deployed per customer as containers on Amazon ECS. These customers each have a 
public hostname they use to access their respective micro-backend.



Currently we are using Amazon’s ALB to dispatch to these services, but each 
load balancer listener has a maximum of 100 rules that can dispatch traffic. As 
such we are managing multiple load balancers, and this something I’d rather not 
do. We are expecting to onboard thousands of customers and are in the process 
of automating the onboarding workflow.



One solution I thought of was to enable service discovery for each of these 
micro-backends to create an internal SRV record with a domain name that can be 
inferred from the public hostname. For example: 
https://customer-a.mypublicdomain.com to http://customer-a.myinternal.domain.



I’d then like to point each public hostname to a single reverse proxy 
(preferably configured with HAProxy). The reverse proxy would then forward the 
request from the public endpoint to the internal domain name by rewriting the 
Host header replacing mypublicdomain.com with myinternal.domain. It would then 
resolve the SRV record for myinternal.domain using a resolver DNS and forward 
the traffic to the internal micro-backend.



In this configuration, I’m looking to have HAProxy rewrite the url and then 
reresolve the rewritten url with a provided DNS rather than setting up a 
thousand backends and having to provide server configuration.



Is HAProxy a good tool for this use case? If so can anyone point me in a 
direction that I might use to configure this. So far every HAProxy 
configuration manual I’ve found that uses service discovery does so requires a 
backend block per service name. In this case micro-backends are added and 
deleted with very high frequency and I’d rather not modify HAProxy config files 
that frequently.



All the best,

Yehuda


Performing URL rewriting and re-resolving new URL using configured DNS

2020-09-11 Thread Yehuda Cohen
Hi all,

Hoping you can help me with this query. I have a selection of micro-backends 
deployed per customer as containers on Amazon ECS. These customers each have a 
public hostname they use to access their respective micro-backend.

Currently we are using Amazon’s ALB to dispatch to these services, but each 
load balancer listener has a maximum of 100 rules that can dispatch traffic. As 
such we are managing multiple load balancers, and this something I’d rather not 
do. We are expecting to onboard thousands of customers and are in the process 
of automating the onboarding workflow.

One solution I thought of was to enable service discovery for each of these 
micro-backends to create an internal SRV record with a domain name that can be 
inferred from the public hostname. For example: 
https://customer-a.mypublicdomain.com to http://customer-a.myinternal.domain.

I’d then like to point each public hostname to a single reverse proxy 
(preferably configured with HAProxy). The reverse proxy would then forward the 
request from the public endpoint to the internal domain name by rewriting the 
Host header replacing mypublicdomain.com with myinternal.domain. It would then 
resolve the SRV record for myinternal.domain using a resolver DNS and forward 
the traffic to the internal micro-backend.

In this configuration, I’m looking to have HAProxy rewrite the url and then 
reresolve the rewritten url with a provided DNS rather than setting up a 
thousand backends and having to provide server configuration.

Is HAProxy a good tool for this use case? If so can anyone point me in a 
direction that I might use to configure this. So far every HAProxy 
configuration manual I’ve found that uses service discovery does so requires a 
backend block per service name. In this case micro-backends are added and 
deleted with very high frequency and I’d rather not modify HAProxy config files 
that frequently.

All the best,
Yehuda