rewrite POST into GET?

Mark Slater lists at humanesoftware.com
Wed Feb 20 13:39:12 MSK 2008


Hey Igor,

Again thank you for such a fast response. I tried the new  
configuration and it works perfectly!

Mark

On Feb 14, 2008, at 10:29 PM, Igor Sysoev wrote:

> On Thu, Feb 14, 2008 at 05:13:57PM -0800, Mark Slater wrote:
>
>> Wow Igor, that was fast! Thank you!
>>
>> I downloaded the development version of nginx (I'd been using the
>> previous stable version 0.5.35), and applied the patch.  
>> Unfortunately,
>> when I started the new version of the server, the post_to_static
>> didn't change the 405 result sent back to facebook.
>>
>> My configuration file looks like this:
>>
>> http {
>>    ...
>>    server {
>>        listen       8080;
>>        server_name  localhost;
>>
>> 	# set the max size for file uploads to 50 MB.
>> 	client_max_body_size 50M;
>>
>>        #charset koi8-r;
>>
>>        access_log  logs/host.vhost.access.log  main;
>> 	root /usr/local/webapps/listage/current/public;
>> 		
>> 	if (-f $document_root/system/maintenance.html) {
>> 		rewrite ^(.*)$ /system/maintenance.html last;
>> 		break;
>> 		post_to_static on;
>> 	}
>>
>>        location / {
>>        ...
>>        }
>>    }
>> }
>>
>> Do I have that right?
>
> I was wrong - the configuration should be changed to:
>
>    server {
>
> 	...
>
> 	if (-f $document_root/system/maintenance.html) {
> 		rewrite ^(.*)$ /system/maintenance.html break;
> 		break;
> 	}
>
> 	location = /system/maintenance.html {
> 		post_to_static on;
> 	}
>
>
> -- 
> Igor Sysoev
> http://sysoev.ru/en/
>






More information about the nginx mailing list