Need help to convert following irule to haproxy
if { [HTTP::header Host] eq “app.site.com” and [HTTP::path] starts_with “/call1”}
{
HTTP::header replace Host “ssl.api.site.com”
HTTP::uri [string map {“/call1” “”} [HTTP::uri]]
}
Need help to convert following irule to haproxy
if { [HTTP::header Host] eq “app.site.com” and [HTTP::path] starts_with “/call1”}
{
HTTP::header replace Host “ssl.api.site.com”
HTTP::uri [string map {“/call1” “”} [HTTP::uri]]
}
Hello,
Here’s how I would do it.
frontend app_site_com
...
acl siteHdr hdr(host) -i app.site.com
acl siteUri path -i -m beg /call1
use_backend ssl_api_site_com if siteHdr siteUri
...
backend ssl_api_site_com
...
http-request set-header Host ssl.api.site.com
http-request set-path "%[path,regsub(^/call1,/)]"
...