23π
If its an internal task that takes too much time for processing, use celery to run the task.
http://docs.celeryproject.org/en/latest/userguide/tasks.html
If its not purely an internal task, eg: β uploading a large file, then increase the Nginx client_body_timeout
to greater than 60s
.
Its because of the default timeout in nginx config. Edit the Nginx virtual host file
and add the following line in server{}
section.
http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_timeout
# default is 60 seconds, For a 300 second timeout.
client_body_timeout 300s;
Edit:
uwsgi_read_timeout 300s;
is also needed. But its already in your config.
4π
Late to the party. I spent hours configuring nginx.cfg and ended up realizing itβs related to the load balancer setting of my EC2 server. If you are using AWS Load Balancers for your EC2 server, try to also increase the Idle timeout
along with the change of nginx.cfg.
1π
My application environment is Django/Python/Nginx and it is not on AWS. I found many clues where they indicated the modification of these parameters and I applied them, but none worked for me until I tried to modify a file called "default" found in /etc/nginx/sites-available/ and added the line:
uwsgi_read_timeout 3600;
I made this modification within the location area of "listen 443", looking like this:
server { listen 443 ... ... location / { uwsgi_pass django; ... uwsgi_read_timeout 3600; } ...
- Recursive crawling with Python and Scrapy
- Reading multidimensional arrays from a POST request in Django
- DJANGO β local variable 'form' referenced before assignment
- Django serialize multiple objects in one call
- Got AttributeError when attempting to get a value for field on serializer