• 맑음동두천 25.8℃
  • 구름조금강릉 27.3℃
  • 맑음서울 26.6℃
  • 구름많음대전 25.0℃
  • 흐림대구 22.6℃
  • 흐림울산 23.8℃
  • 구름많음광주 24.8℃
  • 흐림부산 27.2℃
  • 구름조금고창 25.2℃
  • 제주 24.5℃
  • 맑음강화 25.7℃
  • 구름많음보은 24.4℃
  • 구름많음금산 25.9℃
  • 구름많음강진군 26.3℃
  • 흐림경주시 22.1℃
  • 구름많음거제 25.3℃
기상청 제공

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 :)