1đź‘Ť
After a lucky find in further research (http://answerpot.com/showthread.php?577619-Several%20Bugs/Page2) I found something that helped…
Supplying the uwsgi_pass_request_body off;
parameter in the Nginx conf resolves this problem…
28đź‘Ť
Pass --post-buffering 1
to uwsgi
This will automatically buffer all the http body > 1 byte
The problem is raised by the way nginx manages upstream disconnections
- [Django]-Alowing 'fuzzy' translations in django pages?
- [Django]-In Django, how does one filter a QuerySet with dynamic field lookups?
- [Django]-How to format dateTime in django template?
5đź‘Ť
I hit the same issue, but on my case I can’t disable “uwsgi_pass_request_body” as most times (but not always) my app do need the POST data.
This is the workaround I found, while this issue is not fixed in uwsgi:
http://permalink.gmane.org/gmane.comp.python.wsgi.uwsgi.general/813
import django.core.handlers.wsgi
class ForcePostHandler(django.core.handlers.wsgi.WSGIHandler):
"""Workaround for: http://lists.unbit.it/pipermail/uwsgi/2011-February/001395.html
"""
def get_response(self, request):
request.POST # force reading of POST data
return super(ForcePostHandler, self).get_response(request)
application = ForcePostHandler()
- [Django]-Adding to the "constructor" of a django model
- [Django]-Django and Middleware which uses request.user is always Anonymous
- [Django]-Updating several records at once using Django
5đź‘Ť
I am facing the same issues. I tried all solutions above, but they were not working. Ignoring the response body in my case is simply not an option.
Apparently it is a bug with nginx and uwsgi when dealing with POST requests whose response is smaller than 4052 bytes
What solved it for me was adding “–pep3333-input” to the parameter list of uwsgi. After that all POSTs are returned correctly.
Versions of nginx/uwsgi I’m using:
$ nginx -V
nginx: nginx version: nginx/0.9.6
$ uwsgi --version
uWSGI 0.9.7
- [Django]-Django: how do you serve media / stylesheets and link to them within templates
- [Django]-Difference between Django's filter() and get() methods
- [Django]-Defining nested namespaces in a URLConf, for reversing Django URLs — does anyone have a cogent example?