Client_max_body_size for a location {} Possible?

Is it possible to specify a client_max_body_size and
client_body_buffer_size specifically for a location? If so how?

I need to allow higher buffers for a section that hosts an application.

Thanks

Joseph

Answering myself partially

location /wordpress/wp-admin { client_max_body_size 1m; } <-- does
that apply for evert sub directory such as /wordpress/wp-admin/dir1
/wordpress/wp-admin/dir2/app.php etc

Joseph

From: [email protected]
To: [email protected]
Subject: client_max_body_size for a location {} ? Possible?
Date: Tue, 5 Jun 2012 17:01:34 +0000

Is it possible to specify a client_max_body_size and
client_body_buffer_size specifically for a location? If so how?

I need to allow higher buffers for a section that hosts an application.

Thanks

Joseph

Hello!

On Tue, Jun 05, 2012 at 05:31:25PM +0000, Joseph C. wrote:

Answering myself partially

location /wordpress/wp-admin { client_max_body_size 1m; } ← does that
apply for evert sub directory such as /wordpress/wp-admin/dir1
/wordpress/wp-admin/dir2/app.php etc

See here for details explanation on how locations work:

http://nginx.org/r/location

And here for an answer to your original question:

http://nginx.org/r/client_max_body_size
http://nginx.org/r/client_body_buffer_size

The “context” in the directive description gives a list of places
where the directive is allowed.

Maxim D.

Hello Matt,

Thank you very much. Is there anyway to match this location ONLY for a
specific IP?

    location /wordpress {
                      client_body_buffer_size 1M;
                          client_max_body_size 2M;
                       proxy_pass http://backend1;
                     }

In other words I only one IP 1.1.1.1 to be able to use those special
buffers for that URL… everybody else should use the buffers stated at
the httpd section.

Regards,
Joseph