[LRUG] Rendering maintenance pages?

Adam Carlile adam at benchmedia.co.uk
Wed Jun 26 08:02:20 PDT 2013


If you place an index.html file in "#{Rails.root}/public" it should get served ahead of anything bound into rack.

So you could get a rake task to generate a new index.html file from an existing erb template somewhere in your app.

The danger is of course that if someone isn't accessing the root of your application, that path will still get served.

The safest way is to probably use the web server to switch to a maintenance site at the same domain, reload it, and then run the deploy. linking the site back in after the deployment is complete.

Adam

On 26 Jun 2013, at 15:47, Joel Chippindale <joel.chippindale at gmail.com> wrote:

> LRUG'ers can I tap into your collective wisdom?
> 
> I have a Rails app where I would like to use templates from the app to render a 503 maintenance page each time I deploy, perhaps with a rake task, so that the page can be served statically by my web server when my app is down for maintenance.
> 
> Is there a nice easy way of using Rails to do this? If not, what do you do?
> 
> J.
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org




More information about the Chat mailing list