title: nginx rewrite url to remove subdirectory
body: <p>I would like to rewrite an URL to remove recurring parts from the URL by nginx. Is that possible?</p>
  <p>example: <strong>dummy.com/sub1/sub2/myproject/trunk</strong> --&gt; <strong>dummy.com/myproject/trunk</strong></p>
  <p>Is a nginx rewrite rule the right way to solve this problem?</p>
  <pre><code>location /sub1/sub2 {
    rewrite ^/sub1/sub2/(.*)$ $1 last;
  }
  </code></pre>