Welcome! Log In Create A New Profile

Advanced

Re: Ningx/Django Bad Request Error - Full Solution

Henry Ward
January 18, 2012 03:14PM
Found the problem. A percent symbol snuck into the json data and I was having the same problem as below:

http://www.ruby-forum.com/topic/2573586

Other servers are more forgiving but Nginx was choking on urllib2's handling of escaping the % symbol.

Sorry for the long winded discussion.

Henry

On Jan 18, 2012, at 9:54 AM, Valentin V. Bartenev wrote:

> On Wednesday 18 January 2012 20:58:48 you wrote:
> [...]
>> Error Log
>> The error log shows nothing. Literally. The access_log shows the access
>> url and the 400 error. But the error log does not. I know that is hard
>> to believe its similar to what is said here:
>>
>
> Did you set a correct path to error log in main context (not that one in your
> server section) and debug level? Did you configure and build nginx with debug?
>
> [...]
>> This is what makes so irritatingly difficult to debug. It is also I feel
>> it some type of permission error or setting that does not allow POST
>> requests. I've also read here (https://calomel.org/nginx.html) that Nginx
>> by default only allows GET requests but I couldn't find anywhere where the
>> is verified nor how to enable that.
>
> https://calomel.org/nginx.html
> ## Only allow GET and HEAD request methods. By default Nginx blocks
> ## all requests type other then GET and HEAD for static content.
>
> If you read carefully, you will notice "for static content". That means files in
> your filesystem, obviously, cuz they can't process POST.
>
> Actually, I expect that you POST request is just broken. It's ok for primitive
> django builtin http-server, but it isn't acceptable for nginx.
>
> Why don't you use simple curl for emulate request? Please, try curl.
>
> Or, it may be a django error, cuz of misconfigured fastcgi-param.
> Why don't you use stock fastcgi-params config that distributed with nginx?
>
> [...]
>> I have also created application logging in Django and have "GOT HERE" log
>> statement in the first line of the view that handles the POST request..
>> That line never gets called so it appears Nginx is kicking out the request
>> before it ever passes to the django app.
>
> No. It just means that your request didn't reach the view, that handles POST
> requests. Probably, because of misconfigured fastcgi-param django receive wrong
> or incomplete params.
>
> Anyway, please, investigate and fix your problem with debug log. There's no
> magic.
>
> wbr, Valentin V. Bartenev

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Ningx/Django Bad Request Error

Henry Ward January 17, 2012 07:36PM

Re: Ningx/Django Bad Request Error

xgdlm January 18, 2012 04:38AM

Re: Ningx/Django Bad Request Error

Valentin V. Bartenev January 18, 2012 04:52AM

Re: Ningx/Django Bad Request Error

Henry Ward January 18, 2012 12:00PM

Re: Ningx/Django Bad Request Error - Partial SOLUTION

Henry Ward January 18, 2012 02:26PM

Re: Ningx/Django Bad Request Error - Full Solution

Henry Ward January 18, 2012 03:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 106
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready