| From | Sent On | Attachments |
|---|---|---|
| Mark Slater | Feb 14, 2008 2:12 am | |
| Kenneth Demanawa | Feb 14, 2008 3:46 am | |
| Igor Sysoev | Feb 14, 2008 6:00 am | .txt |
| Mark Slater | Feb 14, 2008 5:13 pm | |
| Igor Sysoev | Feb 14, 2008 10:28 pm | |
| Mark Slater | Feb 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!
Mark






.txt