Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Changing the request based on the domain begining

$
0
0

We have an application where we expect the request in the form
mydomain.com/app/?db=name Where “name” is the customer ID and there could be 100’s of possible names (I hope…)

The customers wish to connect to a vanity URL of name.mydomain.com

To date I have used a redirect with:
http-request set-var(req.subdomain) req.hdr(host),lower,regsub(.mydomain.com$,) if { hdr_end(host) -i .mydomain.com }
http-request redirect code 302 location https://host.mydomain.com/app/?db=%[var(req.subdomain)] if is_app

This works but the end user has the url https://host.mydomain.com/app/?db=name and while it works I have complaints

How would you solve this :slight_smile:

Tim

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles