atom feed6 messages in ru.sysoev.nginxRe: rewrite POST into GET?
FromSent OnAttachments
Mark SlaterFeb 14, 2008 2:12 am 
Kenneth DemanawaFeb 14, 2008 3:46 am 
Igor SysoevFeb 14, 2008 6:00 am.txt
Mark SlaterFeb 14, 2008 5:13 pm 
Igor SysoevFeb 14, 2008 10:28 pm 
Mark SlaterFeb 20, 2008 2:38 am 
Subject:Re: rewrite POST into GET?
From:Kenneth Demanawa (kdem@public.gmane.org)
Date:Feb 14, 2008 3:46:37 am
List:ru.sysoev.nginx

hi mark.

maybe something like ..

... location / { # ...

if ($request_method = POST ) { rewrite (.*) /system_maintenance.html proxy_pass http://rails_app; }

}

ciao :)

On Thu, Feb 14, 2008 at 6:12 PM, Mark Slater
<lists-dGf/XnmI@public.gmane.org> wrote:

I'm working on a facebook application built using Rails. This is my first time deploying a Rails site, and I'm setting up Capistrano to do the heavy lifting. I've got it creating a "down for maintenance" file that I would like served to all facebook requests when I'm updating things, but facebook always sends a POST request. This causes Nginx to respond with a 405 and report "client sent invalid method..."; obviously you can't really POST to a static page.

Is there a way I can re-direct POST requests to GET requests or force Nginx to return the static page regardless of the method used to access it? My backup plan is to deploy a second app on a different set of ports that always returns the "down for maintenance" message.... but it seems silly to run one app to report you're upgrading another.

Thanks!