client_max_body_size per file type

Viewed 124

I'm trying to setup different file size upload limit per file type. I know that client_max_body_size cannot be used in an if statement so I'm trying to use location as so:

location / {
  location ~* ^.+\.(zip|rar) {
     client_max_body_size 30m;
  }
  location ~* ^.+\.(jpe?g|png|pdf) {
     client_max_body_size 10m;
  }
}

But it's not working. Is there a way to implement it?

0 Answers
Related