title: nginx - How rewrite directive works on location matching together with flags?
body: <p>Should following nginx config be dead cycle?</p>
  
  <pre>
  location / {
      # url rewrites
      rewrite ^/(.*).jsp$ /$1.html <b>last</b>;
  
      try_files $uri $uri/ =404;
  }
  
  </pre>
  
  <p>According to doc it seems should, but in test it seems works the same as:</p>
  
  <pre>
  rewrite ^/(.*).jsp$ /$1.html <b>break</b>;
  </pre>
  
  <hr>
  
  <h2><strong>@Update</strong></h2>
  
  <p>About <code>last</code>, nginx doc says:</p>
  
  <blockquote>
    <p>it start a search for a new location that matches the rewritten URL.</p>
  </blockquote>
  
  <p><strong>The questions are:</strong></p>
  
  <ul>
  <li>What does that mean? Does it means to search for the next <code>location</code> directive?</li>
  <li>And what if there is only 1 <code>location</code> where the current <code>last</code> resides, should it stop or .. ?</li>
  </ul>