0

I want to increase max size of attaching images for POSTing in my media directory, but using such instruction i getting 413 Request Entity Too Large

location ~* .+/media/.+\.(jpeg|gif|png|jpg) {
        client_max_body_size 20M;
        }

What is my mistake?

Such instructions as:

location ~* .+/media/.+ {
        client_max_body_size 20M;
        }

and:

 location ~* .+\.(jpeg|gif|png|jpg)$ {
        client_max_body_size 20M;
        }

Don't working too

Sergey M.
  • 298
  • 1
  • 8
  • it must be increased for the uploading script – Deadooshka Apr 07 '17 at 07:58
  • So, if i increase it in uploading script, i have to insert client_max_body_size in server context of nginx, right? By default it is 1mb... – Sergey M. Apr 07 '17 at 08:03
  • if we need a single `location` then we have to copy/`include` the fcgi config there. `location = /upload.php { client_max_body_size 20M; include fcgi_config; }` Otherwise we forced to increase max body size for all scripts in the fcgi `location`. – Deadooshka Apr 07 '17 at 08:17
  • You will need to post more of your configuration for specific help, but `server` context, or the `location` that processes the upload URI. – Richard Smith Apr 07 '17 at 08:34

0 Answers0