<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Helvetica, Arial, sans-serif">I'm curious about your
breaking up the filename into a path like that. If using ext3
filesystem is there any advantage speed wise to doing that? I thought
it could handle large file counts without a problem using indexing but
I may be wrong and I am quite interested as I expect to have thousands
of image files as well and if it's going to be slow on ext3 then I
would also want to split up directories like this.<br>
Chris :)<br>
</font><br>
Maxim Dounin wrote:
<blockquote cite="mid:20080903155835.GK55621@mdounin.ru" type="cite">Hello!
  <br>
  <br>
On Wed, Sep 03, 2008 at 11:33:15PM +0800, Zhang Yining wrote:
  <br>
  <br>
  <blockquote type="cite">Hi list,
    <br>
    <br>
I have a question regarding regex in nginx conf, and believe it must
    <br>
have been brought up before, yet after googling for it, I could not
find
    <br>
an answer.
    <br>
    <br>
Specifically, is it possible to use curly braces in nginx conf?
    <br>
    <br>
For example, for some url like: /photos/123456
    <br>
    <br>
I would want to rewrite it to: /path/to/photos/12/1234/123456.png
    <br>
    <br>
in apache's conf rewrite rule, I could use something like:
    <br>
    <br>
[0-9]{2}[0-9]{2}[0-9]{2}&nbsp; /path/to/photos/$1/$1$2/$1$2$3.png
    <br>
    <br>
But it seems curly braces are reserved for nginx conf file's own use,
    <br>
and not recognized by the regex processing.
    <br>
    <br>
So is there any way to use curly braces in regex? If so, could some one
    <br>
kind enough to provide a link or short explanation of how to do it?
    <br>
  </blockquote>
  <br>
Just quote the regex, i.e:
  <br>
  <br>
rewrite&nbsp; "([0-9]{2})([0-9]{2})([0-9]{2})"&nbsp;
/path/to/photos/$1/$1$2/$1$2$3.png;
  <br>
  <br>
(single quotes will do the trick too).
  <br>
  <br>
It's documented in
<a class="moz-txt-link-freetext" href="http://sysoev.ru/nginx/docs/http/ngx_http_rewrite_module.html#rewrite">http://sysoev.ru/nginx/docs/http/ngx_http_rewrite_module.html#rewrite</a>
(in russian), but not (yet) in english wiki.&nbsp; Feel free to update
<a class="moz-txt-link-freetext" href="http://wiki.codemongers.com/NginxHttpRewriteModule#rewrite">http://wiki.codemongers.com/NginxHttpRewriteModule#rewrite</a>.
  <br>
  <br>
Maxim Dounin
  <br>
  <br>
  <br>
</blockquote>
</body>
</html>