title: how to make nginx redirect
body: <p>I'm trying to do the following:
  There is a site where you can find a user in the format <code>http://localhost/username</code> . I tried to make a rule that if there is no file on the server, then it will redirect to <code>index.php?username=username</code>. But the problem is that it redirects everything, even js and css. I want to do it like this, if the file was on the server, then it would access it, and if not, then it would make a request</p>
  <pre><code>index.php?username=username
  </code></pre>
  <p>There is this piece of code:</p>
  <pre><code>rewrite ^/(.+)$ /index.php?type=userinfo&amp;username=$1 last;
  </code></pre>