How to serve a static website from S3 or Azure Blob with http status 503?
I'm looking for a way to serve a "Maintenance Mode" website from Amazon S3 or Azure Blob storage while I'm updating my website to a new version. I'd like to just flip DNS over to point to maint.mydomain.com (which would be a static site & return 503 http status). Is this possible to do with either of these, or would I need to create a traditional website to host this?
I can get S3 to serve a website, but it always shows HTTP s开发者_如何学运维tatus 200. Any ideas?
The way I ended up solving this is by creating an Azure deployment that just has app_offline.htm. When I need to have an outage, I just deploy that package to production, and have my next version in staging while I do the database migration. Then I do the vip swap to the new version.
The bad part of this is that my previous version is no longer waiting in staging once i've flipped to the new version, but then again I did just change the DB schema so maybe rollback is a little more involved in this scenario anyway.
It seems like you can also make amazon s3 to return 404s for your website during maintenance by specifying incorrect path to the index file and providing correct path for the error page which will be always returned when you hit any url at the endpoint (including root).
You're approaching this wrong.
You should run multiple instances, a staging and a production. Both staging and production are "production" code, but staging is used to actually deploy your changes. Once your staging is up and running you flip the staging and production instances (in Azure this is called a VIP swap). This allows the user to experience an "instant" upgrade (in quotes as there is still some fractional downtime and you can get errors in cases where the user comes in at the exact moment of the switch).
精彩评论