How to set the Proxy to DENY a specific file size and also to ALLOW sites that do not have Content-Length headers


Article ID: 166479


Updated On:


ProxySG Software - SGOS


  1. You want to DENY anyone downloading a file greater than a certain size, for example, 50MB.
  2. You want to ensure proper functionality if the response header does not have a content-length header.


Accomplish this through the Local Policy.

Append the following:


response.header.Content-Length=!"" ALLOW
response.header.Content-Length=!"^[0-9]{1,7}$|^[1-4][0-9]{7.EN_US}$" DENY

Note: If your browser display ".EN_US" in the string, please remove it before applying into Proxy


  1. The first rule allows any sites that does not have a content-length header in its response header.
  2. The second rule denies any file size above 49.999999 MB, which is approximately 50MB.