How to use haproxy's Lua script for dynamically mapping a url?

by Vignesh Swaminathan   Last Updated September 11, 2019 11:00 AM

I have deployed my application using the azure pipelines.I want to integrate the release pipeline with a script that will dynamically update the haproxy.cfg to re-map the Url of an application.

Example for manually mapping in haproxy.cfg

frontend http-in
    mode    http


    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

Now how can I use Lua scripting inside haproxy to automatically map the url of the application.I will invoke this via a command line script from azure release pipeline. I am talking about a generic script here that can be used for all the pipelines. I will be passing all the application specific details to the script as parameter from the pipeline configuration.Plz help with examples of how the script should look like for my haproxy configration.

Note:I want to strictly only use haproxy for this and not nginx.

Tags : azure haproxy

Related Questions

Updated May 07, 2019 16:00 PM

Updated September 10, 2019 13:00 PM

Updated September 09, 2019 08:00 AM

Updated June 22, 2019 01:00 AM