Welcome! Log In Create A New Profile

Advanced

Re: client_max_body_size per $request_uri

Edho Arief
January 28, 2012 08:42AM
On Sat, Jan 28, 2012 at 8:16 PM, skyroski <nginx-forum@nginx.us> wrote:
> For the record, I used a combination of a similar issue in the mailing
> list and a combination of what @Valentin suggested.
>
> In the end, this is what works for me:
>
> if ($request_uri ~* upload$) {
>  rewrite ^/(.*)$ /upload/$1 last;
> }
>
> location ~ /upload/(.*)$ {
>  internal;
>  client_max_body_size 200M;
>  fastcgi_param PHP_VALUE ....;
>  fastcgi_pass php;
>  fastcgi_param SCRIPT_FILENAME $document_root/index.php;
>  include fastcgi_params;
>  fastcgi_param QUERY_STRING /$1;
>  fastcgi_param DOCUMENT_URI /index.php;
>  fastcgi_param SCRIPT_FILENAME /index.php;
> }
>
> All the rest I didn't have to change with the exception of adding an
> extra clause to the location \.php$ block to restore PHP_VALUE to
> default settings.
>
> I understand around-abouts why IF is evil but if it's supposed to be
> safe for rewrites and return then I'd rather take advantage of that
> instead of using location / with try files so that I can deal with query
> strings attachments easier and it ends up shorter to implement.
>

too bad this doesn't work :/

map $request_uri $uplimit {
~upload$ 200m;
default 1m;
}
client_max_body_size $uplimit;

--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

client_max_body_size per $request_uri

skyroski January 28, 2012 05:52AM

Re: client_max_body_size per $request_uri

Edho Arief January 28, 2012 06:38AM

Re: client_max_body_size per $request_uri

Valentin V. Bartenev January 28, 2012 06:58AM

Re: client_max_body_size per $request_uri

skyroski January 28, 2012 08:16AM

Re: client_max_body_size per $request_uri

Edho Arief January 28, 2012 08:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 263
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready