0

I have a django app which was serving with Nginx on ubuntu. My basic nginx conf as of now was below which was working fine

server {
  listen 8005; 
  location / { 
    proxy_pass http://127.0.0.1:8001;
  }

  location /static/ {
    alias /root/apps/proj/files/new_media/;
  }

  location /media/ {
    alias  /root/apps/proj/files/media/;
  }

  location /new_media/ {
   alias  /root/apps/proj/files/new_media/;
  }
} 

I have a url like http://localhost:8000/csv/process_head_positions/ which deals with the csv files(nearly 5000 records), that is the view of the above url will process each and every line of csv file and do some thing.... So this url was working fine in the local but when i tried the same process(that is i uploaded the csv file with 5000 lines in to a form int he above url) and clicked submit, then after 30 seconds i am getting

502 Badgateway
(nginx/ubuntu 14.2...)

But when i searched in the error log file on nginx i found this error message below

2014/07/04 13:15:28 [error] 5240#0: *352 upstream prematurely closed connection while reading response header from upstream, client: xxx.xx.xx.xxx, server: , request: "POST /csv/process_head_positions/ HTTP/1.1", upstream: "http://127.0.0.1:8003/easyadmin/district_locator_output/", host: "xx.xxx.xxx.xx:8007", referrer: "http://xx.xxx.xxx.xx:8007/csv/process_head_positions/"

So are there any settings that we need to specify more in the above conf file in order to handle large requests in nginx ?

Shiva Krishna Bavandla
  • 25,548
  • 75
  • 193
  • 313

0 Answers0