Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to set client_max_body_size dynamic for nginx

I want to config dynamically client_max_body_size using a variable in nginx config.

set $max_body 100M; 
client_max_body_size $max_body;

How to patch nginx for this?

Thanks,

like image 528
quang nguyen Avatar asked Nov 01 '14 01:11

quang nguyen


1 Answers

You can't.

Directive client_max_body_size doesn't accept variables and is not usable in a if block.

like image 168
Xavier Lucas Avatar answered Sep 30 '22 17:09

Xavier Lucas