title: Nginx rewrite rule for Node.js
body: <p>I'm setting up Nginx as a reverse proxy for a Node.JS application.
  Node app listens on localhost:3003 and proxy is set up like this:</p>
  
  <pre><code>location /otfb {
              proxy_pass http://127.0.0.1:3003;
              #...
  }
  </code></pre>
  
  <p>Now the problem is that if I access server like this:</p>
  
  <pre><code>http://server.xyz/otfb/someresource
  </code></pre>
  
  <p>then it is passed to Node.JS as</p>
  
  <pre><code>http://localhost:3003/otfb/someresource
  </code></pre>
  
  <p>But correct will be</p>
  
  <pre><code>http://localhost:3003/someresource
  </code></pre>
  
  <p>Show how to set up rewrite rule so that <strong>otfb</strong> will be removed by Nginx before request is passed to Node.JS</p>