Too Many Redirects - CDN Rewrite Rule

Peter Booth Peter_Booth at
Fri Mar 22 04:31:35 UTC 2013

What netdna said is sensible and I imagine any cdn would say the same. Ultimately the ball is in your court.

If you want to use a CDN (and it's not compulsory) then change your app so that the image links are absolute links with the cdn domain name. There's no good reason for nginx to have any part of this

Sent from my iPhone

On Mar 21, 2013, at 6:49 PM, "toddlahman" <nginx-forum at> wrote:

> The reply I received from NetDNA after supplying the same information as I
> did here is as follows:
> "Too many redirects" is a legit message in this scenario - example: You are
> redirecting TO ---> request
> comes to CDN and CDN neds to cache this file from origin so it tries to
> fetch from origin from location "" ---> request comes to
> origin and redirect rule you made redirects this request back to CDN <---
> this is where infinite loop starts.
> This is not a proper way to implement CDN as you have to monitor who is
> requesting your origin file so you could know whether it's a request you
> want to redirect or not. The best way to handle this is to monitor our
> anycast IPs and redirect everything except for those ips:
> If you want to implement CDN this way, we can't support that implementation
> as we don't really encourage our client to use this type of implementation.
> The reason is quite simple: We are going to add new IP block that has to be
> white listed and until you make update for your redirects rule you'll be
> pushing infinite redirects to our servers causing service not to work until
> you add new block as well.
> Posted at Nginx Forum:,237609,237661#msg-237661
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list