Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For a given url pattern, I want the contents of the file to be fetched from a CDN and not from my web server.


I need to extract:

ford new 1 2

I want to fetch the file from the s3 (or CDN) like:

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.

share|improve this question

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 ?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.