May 08, 2012 05:53AM
OK, in the end I went with:

if ($http_user_agent !~ "Amazon CloudFront") {
rewrite ^/(.*).(png|gif|jpg) http://abc.cloudfront.net/$1.$2
}

which seems to do the trick. Seems like there should be a better way of doing what must be quite a common form of rewrite though? (Or is this the fast alternative to Apache's REWRITE_COND?)
Subject Author Posted

Best way to redirect non-CloudFront requests to CloudFront

WheresWardy May 03, 2012 09:05AM

Re: Best way to redirect non-CloudFront requests to CloudFront

Alexandr Gomoliako May 03, 2012 09:18AM

Re: Best way to redirect non-CloudFront requests to CloudFront

WheresWardy May 03, 2012 09:44AM

Re: Best way to redirect non-CloudFront requests to CloudFront

WheresWardy May 08, 2012 05:53AM

Re: Best way to redirect non-CloudFront requests to CloudFront

Jonathan Matthews May 08, 2012 07:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 161
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready