For a given url pattern, I want the contents of the file to be fetched from a CDN and not from my web server.
example:
www.example.com/some/path/ford/new?a=1&b=2
I need to extract:
ford new 1 2
I want to fetch the file from the s3 (or CDN) like:
example-com.s3.com/customers/ford.new.1.2.html
Is this possible at the HAProxy level or would I have to do this in nginx somehow?
The earlier in the pipeline the better obviously.
I remind having had to deal with something similar once, I believe the principle was the following :
1) from the frontend, match the URL using an ACL and go to a specific backend 2) in this backend first rewrite the URL using reqirep 3) then perform the redirect with "redirect ... prefix /" which will reuse the same URL.
However in your case I see a host name, and the host name is not part of the URI line, so it's not possible to make it appear there (not possible to combine two lines yet). But maybe you don't need that many hosts and can live with a few rules ?