'Timeout issue in django with nginx and gunicorn

I have few rest API,s in django that take more then one minute to get Data. Because there are more then 20 million records in database. But It show time out after one minute . How to increase timeout ?. I have searched the internet and made changes in Nginx and Gunicorn accordingly but It still show time out after one minute when i hit the API with postman.

Nginx Config file -

    location / {

proxy_set_header Host $http_host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_set_header X-Forwarded-Proto $scheme;

proxy_pass http://unix:/home/neeraj/run/gunicorn.sock;

proxy_connect_timeout 500;

proxy_read_timeout 500s;  }

Gunicorn.service file -

ExecStart=/home/neeraj/cashvenv/bin/gunicorn --error-logfile /home/neeraj/run/gerror.log --workers 3 --timeout 500 --bind unix:/home/neeraj/run/gunicorn.sock Cash.wsgi:application

edit nginx logs

 - - [13/Feb/2022:15:49:25 +0530] "POST /reporting/dashboard/cards HTTP/1.1" 499 0 "-" "PostmanRuntime/7.28.4" "

Please help me out with this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source