nginx and self-healing S3 static hosting
skateinmars at skateinmars.net
Wed Jul 30 00:42:15 MSD 2008
Ian M. Evans a écrit :
> Jean-Philippe wrote:
>> However this rewrite system does not seem clean. I think it would be
>> better to simply use dns and subdomains for your static files, and
>> change the subdomain used when s3 is down.
> I'm not sure I'm totally following this last paragraph.
> Do you mean have two cnames, say, s3.example.com and local.example.com
> and change the rewrite depending on the check files existence?
> Sorry...up in the wee hours with a head cold. :-(
If you use URL rewriting, your requests will have to go trough nginx to be
redirected, which is inefficient.
Just use an assets servers like files.example.com in an s3 instance. Set up an
additional nginx vhost and if s3 goes down you'll just have to modify the DNS.
More information about the nginx