title: Nginx rewriting pushstate static resources wont load
body: <p>I am trying to get <code>nginx</code> to work with a pushstate based uri handled by <code>react-router</code>.
  Everything works fine until I try to F5 on a second level uri <code>example.com/MyApp/users</code>.</p>
  
  <p>My static resources are in <code>example.com/MyApp/resources</code>.
  The problem is that nginx is trying to load my resources in <code>example.com/MyApp/users/resources</code> whenever I try to access directly (or F5) the <code>users</code>'s view.</p>
  
  <p>Here is my nginx conf :</p>
  
  <pre><code>location ~ ^/MyApp/ {
      try_files $uri /MyApp/index.html last;
  }
  </code></pre>
  
  <p>I am new to nginx so I don't really know how everything works...</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>I changed my conf to this:</p>
  
  <pre><code>location / {
      if (!-e $request_filename){
          rewrite ^(.*)$ /MyApp/index.html break;
      }
  }
  </code></pre>
  
  <p>Now accessing to <code>example.com/MyApp/users</code> works but <code>example.com/MyApp/users/</code> doesn't.</p>