title: Nginx reverse proxy configuration to handle absolute paths
body: <p>I am running a web application on <code>http://localhost:9000</code>
  that I would like to reverse proxy to <code>http://localhost/myapplication</code>. </p>
  
  <p>The problem is that the application is using absolute paths <code>&lt;a href="/some-directory/some-file.html"&gt;link&lt;/a&gt;</code> which is translated to <code>http://localhost/some-directory/some-file.html</code> with my current configuration. </p>
  
  <p>How do I configure nginx to handle these paths so that they point to <code>http://localhost/myapplication/some-directory/some-file.html</code> instead?</p>
  
  <p>Right now the proxy pass configuration looks like this:</p>
  
  <pre><code>    location /myapplication/ {
              proxy_pass       http://localhost:9000/;
              proxy_set_header X-Forwarded-Host $host;
              proxy_set_header X-Forwarded-Server $host;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      }
  </code></pre>