I'm hosting a Flask built website with Gunicorn and Nginx through Supervisor, which works perfectly well. In my supervisord.conf
file I run gunicorn as follows:
command=/home/beta/imd/venv/bin/gunicorn --worker-class eventlet -b 127.0.0.1:5000 -w 1 app:app
I now tried running Gunicorn directly without Nginx in front of it using the following command (to include logging)
sudo /home/beta/imd/venv/bin/gunicorn \
--worker-class eventlet \
-b 0.0.0.0:80 \
-w 1 \
--access-logfile /home/beta/gunicorn_access.log \
--error-logfile /home/beta/gunicorn_error.log \
app:app
but when opening a webpage, two of the 20 requests the page consists of (an image and Twitter Bootstrap css file) give an ERR_CONTENT_LENGTH_MISMATCH
.
I checked out the gunicorn logs, but in there nothing strange seems to happen. I get no error and the access logs report regular 200
status codes.
I get the error in Chrome, Opera and Safari, but not in Firefox.
I find it so strange that it doesn't happen when also using Nginx, which suggests that Nginx adjusts the content-length
headers.
Does anybody know what could cause this problem?