agentzh Wrote:
-------------------------------------------------------
> On Mon, Nov 28, 2011 at 4:11 PM, mennanov
> <nginx-forum@nginx.us> wrote:
> >
> > location ~ /i/(.*)\.jpg {
> > set $folder $1-($1%100);
> > try_files /i/$folder/$1.jpg
> =400;
> > }
> >
> > but of course it does not work due to syntax
> error.
> >
>
> The standard "set" directive does not support
> arithmetic operations at
> all. But it's an ideal use case for our ngx_lua
> module:
>
> location ~ /i/(.*)\.jpg {
> set_by_lua $folder 'return ngx.var[1] -
> (ngx.var[1] % 100)';
> try_files /i/$folder/$1.jpg =400;
> }
>
> See http://wiki.nginx.org/HttpLuaModule for
> details.
>
> Regards,
> -agentzh
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
Thank you so much, i've just recompiled nginx with this module and it just works!