title: nginx rewrite question
body: <p>I need to do a rewrite with nginx from /blah/.../3275 to /id/3275 if the second file exists, otherwise I want to hand it off to apache. Here is my (feeble) attempt</p>
  
  <p>(...) represents irrelevant stuff</p>
  
  <pre><code>if ($request_filename ~^/.../([0-9]+)/$) {
                 if (-d /id/$1) {
                          rewrite ^/.../[0-9]+/([0-9]+)/$ /id/$1;
                  }
          }
  </code></pre>
  
  <p>Does anyone have any ideas</p>