I'm getting an error when running my Django app with gunicorn: when I make a post request over 7800 bytes I see the following error from gunicorn:
"Error opening file for reading: Permission denied".
It then drops the request and nginx is getting a "Connection reset by peer" error.
This doesn't happen if I run the Django development server instead. Strangely, if I make the request to an invalid URL, no matter what the post content length, I get the standard Django debug webpage.
So it seems to be how gunicorn is handling something that Django is doing when it's processing a request for a valid view URL.
This is being run on Ubuntu 12.04. I've tried running Gunicorn as root and it still happens.
I'm at a bit of a loss on how to debug this any further. I've tried setting the tmp_upload_dir to a directory will full permissions incase that was an issue, but no luck.
Any advice would really be appreciated.
Best Answer
You need to allow the host in the ALLOWED_HOSTS in your settings.py
I would expect a more descriptive error message, but unfortunately, this is what we get.