<-
Apache > HTTP Server > Documentation > Version 2.4 > Modules

Apache Module mod_reqtimeout

Available Languages:  en  |  fr 

Description:Set timeout and minimum data rate for receiving requests
Status:Extension
Module Identifier:reqtimeout_module
Source File:mod_reqtimeout.c
Compatibility:Available in Apache HTTPD 2.2.15 and later

Summary

This module provides a convenient way to set timeouts and minimum data rates for receiving requests. Should a timeout occur or a data rate be to low, the corresponding connection will be closed by the server.

This is logged at LogLevel info.

If needed, the LogLevel directive can be tweaked to explicitly log it:

LogLevel reqtimeout:info
Support Apache!

Topics

Directives

Bugfix checklist

See also

top

Examples

  1. Allow for 5 seconds to complete the TLS handshake, 10 seconds to receive the request headers and 30 seconds for receiving the request body:
    RequestReadTimeout handshake=5 header=10 body=30
  2. Allow at least 10 seconds to receive the request body. If the client sends data, increase the timeout by 1 second for every 1000 bytes received, with no upper limit for the timeout (except for the limit given indirectly by LimitRequestBody):
    RequestReadTimeout body=10,MinRate=1000
  3. Allow at least 10 seconds to receive the request headers. If the client sends data, increase the timeout by 1 second for every 500 bytes received. But do not allow more than 30 seconds for the request headers:
    RequestReadTimeout header=10-30,MinRate=500
  4. Usually, a server should have both header and body timeouts configured. If a common configuration is used for http and https virtual hosts, the timeouts should not be set too low:
    RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500
top

RequestReadTimeout Directive

Description:Set timeout values for completing the TLS handshake, receiving the request headers and/or body from client.
Syntax:RequestReadTimeout [handshake=timeout[-maxtimeout][,MinRate=rate] [header=timeout[-maxtimeout][,MinRate=rate] [body=timeout[-maxtimeout][,MinRate=rate]
Default:RequestReadTimeout handshake=0 header=20-40,MinRate=500 body=20,MinRate=500
Context:server config, virtual host
Status:Extension
Module:mod_reqtimeout
Compatibility:Available in version 2.2.15 and later; defaulted to disabled in version 2.3.14 and earlier. The handshake stage is available since version 2.4.39.

This directive can set various timeouts for completing the TLS handshake, receiving the request headers and/or the request body from the client. If the client fails to complete each of these stages within the configured time, a 408 REQUEST TIME OUT error is sent.