0

I am using Apache HTTPD 2.4 in my web application along with it's httpd.conf file which ensures desired requests handling. I have already defined some proxy rules to redirect reqests into proper backend endpoints and everything works fine excepts timeout configuration..

I'd like to define different timeouts for requests with header and different for requests with body to differentiate POST and GET methods processing time. As global Timeout property is not appropriate for my needs (some file upload features requires up to 5mins of request processing, whereas simple GETs up to few seconds so I'd like to change bad looking global timeout value of: Timeout=300.

I thought that I found solution in Apache Module mod_reqtimeout - so I've loaded aforementioned module on my frontend's Docker image with CentOS using LoadModule reqtimeout_module modules/mod_reqtimeout.so and checked successfully it's status with apachectl -M. Finally I've defined RequestReadTimeout header=10 body=30 and commented out global timeout param to test new approach but it looks that configuration uses default 60secs of global timeout parameter.

How to force Apache to use new timeout rules? To test it I've created two simple endpoints: GET with header and POST with body to test with Postman which both inside use Java's Thread.sleep with given amout of time.

Macieyo
  • 440
  • 6
  • 15

1 Answers1

0

I don't know if it will fix your problem in the way you like, but you can use the command:

set_time_limit(0);

In your .php file that calls the 5 minutes POSTS and it will have no limit for the Request

David Dutra
  • 391
  • 7
  • 21
  • Thanks for your answer! The case is that still I'd like to have timeouts defined. As far as I know unlimited time of requests could make my app DoS enabled. I would rather prefer to just omit global timeout of 5mins, specify shorter one for requests with headers only and a bit longer timeout for requests with body. – Macieyo Aug 01 '17 at 07:13