Take the 2-minute tour ×

How do I get the size of the response/request body in Mod Security?

I keep getting this error for example:

[Mon Sep 17 23:34:38 2012] [error] [client] ModSecurity: Output filter: Response body too large (over limit of 1000, total not specified). [hostname "example.com"] [uri "/index.php"] [unique_id "asdf"]

It's not telling me the total; how can I figure the total out?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Take a look at the SecResponseBodyLimit docs:


Description: Configures the maximum response body size that will be accepted for buffering.

Syntax: SecResponseBodyLimit NUMBER_IN_BYTES

Example Usage: SecResponseBodyLimit 524228

Processing Phase: N/A

Scope: Any

Dependencies/Notes: Anything over this limit will be rejected with status code 500 Internal Server Error. This setting will not affect the responses with MIME types that are not marked for buffering. There is a hard limit of 1 GB.

By default this limit is configured to 512 KB:

# Buffer response bodies of up to 512 KB in length
SecResponseBodyLimit 524288

For some reason, you have it set to "1000" and /index.php's output is larger than 1000 bytes.

share|improve this answer
I know how to change it, I'm trying to find the response size so I can adjust it as needed. –  josten Sep 18 '12 at 4:31
@user973917 Turn off mod_security, load /index.php and see how large the file you get back is. –  Jon Lin Sep 18 '12 at 4:34
I would like for the size to reported in the log. –  josten Sep 18 '12 at 4:37
@user973917 It won't because when the size of the response body is larger than the SecResponseBodyLimit, it simply gives up and returns a 500. It doesn't read the rest of it to report how large it was. –  Jon Lin Sep 18 '12 at 4:38
Exactly what I wasn't hoping for; thanks though. –  josten Sep 18 '12 at 4:55
add comment

Your Answer


