mirror of
https://github.com/bunkerity/bunkerized-nginx
synced 2023-12-13 21:30:18 +01:00
Merge pull request #313 from TheophileDiot/Feature-max-client-size-edit-modsec
Variable MAX_CLIENT_SIZE change the SecRequestBodyLimit value
This commit is contained in:
commit
01cecf14e5
1 changed files with 10 additions and 0 deletions
|
@ -13,7 +13,17 @@ SecRule REQUEST_HEADERS:Content-Type "application/json" \
|
|||
"id:'200001',phase:1,t:none,t:lowercase,pass,nolog,ctl:requestBodyProcessor=JSON"
|
||||
|
||||
# maximum data size
|
||||
{% if MAX_CLIENT_SIZE.endswith("k") or MAX_CLIENT_SIZE.endswith("K") %}
|
||||
SecRequestBodyLimit {{ MAX_CLIENT_SIZE[:-1] | int * 1024 }}
|
||||
{% elif MAX_CLIENT_SIZE.endswith("m") or MAX_CLIENT_SIZE.endswith("M") %}
|
||||
SecRequestBodyLimit {{ MAX_CLIENT_SIZE[:-1] | int * 1024 * 1024 }}
|
||||
{% elif MAX_CLIENT_SIZE.endswith("g") or MAX_CLIENT_SIZE.endswith("G") %}
|
||||
SecRequestBodyLimit {{ MAX_CLIENT_SIZE[:-1] | int * 1024 * 1024 * 1024 }}
|
||||
{% elif MAX_CLIENT_SIZE.isdigit() %}
|
||||
SecRequestBodyLimit {{ MAX_CLIENT_SIZE }}
|
||||
{% else %}
|
||||
SecRequestBodyLimit 13107200
|
||||
{% endif %}
|
||||
SecRequestBodyNoFilesLimit 131072
|
||||
|
||||
# reject requests if bigger than max data size
|
||||
|
|
Loading…
Reference in a new issue