fastcgi_send_timeout
Sets the timeout for sending responses to the FastCGI server.
Description
The fastcgi_send_timeout directive specifies the maximum time that NGINX will wait for a FastCGI server to send a response. If the time exceeds this limit, NGINX will terminate the connection with the FastCGI server and return an error to the client. The value is specified in milliseconds, and it can help prevent delays caused by unresponsive FastCGI applications. The directive can be set at the http, server, or location block level, allowing for flexible configuration depending on the specific use case.
When configuring the fastcgi_send_timeout, it is important to set an appropriate value based on the expected response times of your FastCGI backend. A too-short timeout may lead to unnecessary errors for normal requests, while a too-long timeout may delay the processing of unresponsive requests. The directive's behavior can be further refined by using it in conjunction with other directives like fastcgi_read_timeout and fastcgi_buffering, controlling both the response handling and timeout strategies effectively.
Config Example
location /app {
include fastcgi_params;
fastcgi_pass backend;
fastcgi_send_timeout 30s;
}Setting the timeout value too low may result in premature termination of legitimate requests.
Not configuring this directive alongside fastcgi_read_timeout may lead to inconsistent behavior during long processing times.