title: Nginx - Rewrite the request_uri before uwsgi_pass
body: <p>I have a Nginx vhost than is configured as such:</p>
  
  <pre><code>...
  location /one {
    include uwsgi_params;
    uwsgi_pass unix:///.../one.sock;
  }
  location /two {
    include uwsgi_params;
    uwsgi_pass unix:///.../two.sock
  }
  ...
  </code></pre>
  
  <p><em>This is a simplified configuration of course</em></p>
  
  <p>When I request <code>/one/something</code> I would like my Python script to receive <code>/something</code> as <code>request_uri</code>.</p>
  
  <p>I'm using BottlePy but would like this to be handled by Nginx and not in my Python code.</p>
  
  <p>Can I do something like <code>uwsgi_param REQUEST_URI replace($request_uri, '^/one', '')</code>?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Here is the request from my Python code:
  
  [pid: 30052|app: 0|req: 1/1]  () {42 vars in 844 bytes} [Tue Aug 21 14:22:07 2012] GET /one/something => generated 0 bytes in 4 msecs (HTTP/1.1 200) 2 headers in 85 bytes (0 switches on core 0)</p>
  
  <p>So Python is OK but uWSGI is not.</p>
  
  <p>How to fix that?</p>