0

I have the following setting for IE in my httpd.conf:

BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0

I want to apply this to all requests that hit my server.

My httpd.conf section that deals with keep alive looks like this:

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 5

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive Off

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 1

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 1

How do I do this?

petey
  • 572
  • 3
  • 9
  • 20

1 Answers1

3

If you want to disable HTTP keep-alive for all browsers just set KeepAlive to off globally.

No sense wasting resources on a BrowserMatch if you don't have to, but if you really want to use BrowserMatch just compose a regular expression that matches anything. ".*" is a good one.

voretaq7
  • 79,879
  • 17
  • 130
  • 214
  • KeepAlive was already set to off. Does the client need to do something to stop receiving a connection state of keep-alive after a http get is invoked? – petey Aug 14 '13 at 18:57
  • If `KeepAlive` is Off and not overridden anywhere else then keep-alives should simply not work. I suspect there's more to this that you're not telling us -- what specifically are you trying to accomplish? – voretaq7 Aug 14 '13 at 20:13
  • I have a client trying to do a get against a service I have. It just returns a few characters. I have posted all the parameters concerning the keep alive in the question above. – petey Aug 14 '13 at 20:37
  • hmm... I'm not sure Keepalive is your problem, but you certainly appear to have it turned off. You can use my notes above to set HTTP/1.0 for all browsers and see if that helps. If not there may be something else going on... – voretaq7 Aug 14 '13 at 20:52
  • 1
    I set MaxKeepAliveRequests to 0 and KeepAlive now stays off. – petey Aug 14 '13 at 22:51
  • Note: If you set `MaxKeepAliveRequests` to `0` it means Unlimited requests per 1 connection. If you want to disable `KeepAlive`, set it to `Off` in global or virtual host's section. – NullIsNot0 Mar 10 '23 at 15:19