I have asked the same question before but i din't get any answers for it.I know how to manually map applications listening on various ports to Specific Url. For example, adding the below Haproxy configuration will let me map the URL http://206.189.22.155:30000/designer-api/ to URL http://206.189.22.155/designer-api/.
haproxy configuration used for mapping URL
frontend http-in
mode http
bind 206.189.22.155:80
acl path-page-designer path_beg -i /designer-api/
use_backend page-designer-backend if path-page-designer
backend page-designer-backend
mode http
option httplog
option forwardfor
server appserver1 206.189.22.155:30000
So this works perfectly fine.But now I want to take a step further in automating this.How to write a script that can remap the ports automatically.I mean rather than configuring this manually in the haproxy.cfg, the mapping has to be done dynamically because later i will integrate the script into azure release pipelines.