I met a trouble with the size of my request. I have tried to send 14 pictures in my request so the body_size was superior to 1.5 Mb, I got “413 Entity too large”. So I followed instructions I found here and increased the client_max_body_size to 10 Mb in nginx.conf https://datanextsolutions.com/blog/how-to-fix-nginx-413-request-entity-too-large-error/
Now the problem is not fixed, I dont meet 413 anymore but now I meet “502 Bad Gateway” and a part of my request is readed (10 / 14 pictures are correctly uploaded and I made a lot of test, the problem doesn’t come from the image)
When I run “sudo tail -F /var/log/nginx/error.log” I can see “upstream prematurely closed connection while reading response header from upstream”
It is really strange because when I run the application in virtual environment on server The request is correctly launched and the 14 images are uplaoded.
Notice that I already investigate the timeout response and added this in nginx/sites-enabled
include proxy_params; proxy_pass http://unix:/run/gunicorn.sock; proxy_read_timeout 300s; proxy_connect_timeout 75s;
Thanks for reading
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!