title: How to remove subdirectory with nginx from urls using try_files
body: <p>The whole day I try to find a solution for the specific problem.</p>
  
  <p>My structure looks like these:</p>
  
  <pre><code>location / {
  try_files $uri $uri/ /index.php?$uri&amp;$args;
  }
  </code></pre>
  
  <p>Now all php-files of a subdirectory should be parsed in /index.php as well.</p>
  
  <pre><code>location /subdir/ {
  try_files $uri $uri/ /index.php?$uri&amp;$args;
  }
  </code></pre>
  
  <p>When I click <code>/subdir/thread.php?t=123</code> then <code>$uri</code> contains <code>/subdir/thread.php?t=123</code>. But I would like to have only <code>/thread.php?t=123</code> in <code>$uri</code> (without subdir).</p>
  
  <p>Is this possible? I don't want to use rewrites because I use this script for a redirect script.</p>