freerunningtech/frt-opsworks-cookbooks — pull request #12 by adammathys (2014-05-26 21:14:22+00:00)
Title: Add nginx config to allow for a maintenance page

Relatively simple change. It ensures that anything under `$root/static` will be rendered and if there's a `$root/offline` file it will return 503 for all requests and render `$root/maintenance.html`. This allows applications to store any necessary images, CSS or JS in `$root/static` and still have it rendered correctly on the maintenance page.

I chose `$root/static` in favor of sticking things in `/assets/` because that folder is used for compile assets. However, since the maintenance page isn't part of the rails application it won't use sprockets for it's assets. In the most recent versions of Rails you can't serve both non-digested and digested assets. As such, I felt the simplest approach was to have a secondary folder called static where assets for error pages could be placed.