Q:

Handling PUT requests returning 403 errors with Django Rest Framework, nginx and uwsgi

I am testing porting an access-controlled web service implemented using Django REST Framework to nginx/uwsgi.  When I'm testing PUT requests which return 403 errors because the user doesn't have permission for that endpoint, I sometimes get errors like this in the logs:
2016/02/09 06:42:05 [error] 574#0: *14978766 readv() failed (104: Connection reset by peer) while reading upstream, client: 10.10.10.10, server: test.whatever.com, request: "PUT /api/1.0/domains/name/Quest/page_content/name/Resit/ HTTP/1.1", upstream: "uwsgi://unix:///tmp/ipp_api_uwsgi.soc:", host: "test.whatever.com"

There are a few questions about this problem.  The suggested solutions are: 

EITHER make sure you consume the request's post data in the
application OR
use the --post-buffering command line option
for uwsgi. 

Option 1 does not seem the right way to go - DRF's permissioning module checks whether the user has the access rights to the endpoint and rejects the PUT if they don't.  The post data is never accessed and should just be dumped. 
Option 2 seems to fix the problem but I am concerned about performance and the impact on other, successful PUT requests. 
Is option 2 the approach I should follow?  Any other suggestions? 

A:

post-buffering will cause uWSGI to consume and buffer body requests, so yes, it can affect performance for example if someone will make lot of request without permission to do.  uWSGI will buffer them all instead of just rejecting. 
But you can handle it in django app, using proper middleware that will just throw all body of request into /dev/null when there is no permission to perform any action. 