Rohan
Rohan

Reputation: 2727

Nginx server timeout not increasing

Is there a way to increase timeout of nginx as the application is taking around 2 minutes to respond while nginx has a timeout of 60 seconds. Tried below mentioned settings:

client_header_timeout 600s;
client_body_timeout 600s;
keepalive_timeout 600s;
proxy_read_timeout 600s;
proxy_send_timeout 600s;
send_timeout 600s;

I am using Nginx+Passenger and Rails Web Framework and as I can see the logs the app is responding with Completed status.

Upvotes: 1

Views: 983

Answers (1)

Anthony Lazam
Anthony Lazam

Reputation: 38

There's an option to increase the max timeout using Passenger but it's only available in Enterprise mode.

location /longtimeout {
    passenger_enabled on;
    passenger_max_request_time 300;
}

Any requests going to /longtimeout will now able to process it for 300 seconds before terminating the connection. Please refer here for more details: https://www.phusionpassenger.com/library/config/nginx/reference/#passenger_max_request_time

Upvotes: 1

Related Questions