• 구름많음동두천 17.6℃
  • 맑음강릉 20.3℃
  • 구름많음서울 18.2℃
  • 맑음대전 18.5℃
  • 맑음대구 19.0℃
  • 맑음울산 20.0℃
  • 맑음광주 18.4℃
  • 맑음부산 19.1℃
  • 맑음고창 18.4℃
  • 맑음제주 21.3℃
  • 구름많음강화 15.3℃
  • 구름조금보은 17.3℃
  • 맑음금산 18.1℃
  • 맑음강진군 18.7℃
  • 구름조금경주시 20.7℃
  • 맑음거제 19.7℃
기상청 제공

nginx 504 gateway time-out

  • 등록 -0001.11.30 00:00:00

I am running Django, FastCGI, and Nginx. I am creating an api of sorts that where someone can send some data via XML which I will process and then return some status codes for each node that was sent over.

The problem is that Nginx will throw a 504 Gateway Time-out if I take too long to process the XML -- I think longer than 60 seconds.

So I would like to set up Nginx so that if any requests matching the location /api will not time out for 120 seconds. What setting will accomplish that.

What I have so far is:

    # Handles all api calls 
    location ^~ /api/ { 
        proxy_read_timeout 120; 
        proxy_connect_timeout 120; 
        fastcgi_pass 127.0.0.1:8080; 
    } 

Edit: What I have is not working :)