title: gunicorn via mod_proxy is redirecting outside of the project's scope, despite ProxyPassReverse
body: <p>I have a WSGI-app (a Django project) running under gunicorn on <code>127.0.0.1:18731</code> and I use Apache with mod_proxy to redirect requests from <code>http://example.com/my-project/*</code> to <code>http://127.0.0.1:18731/*</code>. Static files are stored outside of <code>/my-project/</code>. If the Django app does not need to redirect anything, this works just fine, but if it tries to redirect a request (e.g. to add a trailing slash to <code>http://example.com/my-project/foo</code>), it ends up removing <code>/my-project/</code> from the URL, leaving me with the invalid URL <code>http://example.com/foo/</code>.</p>
  
  <p>My mod_proxy configuration is as follows:</p>
  
  <pre><code>&lt;Proxy *&gt;
      Order deny,allow
      Allow from all
  &lt;/Proxy&gt;
  ProxyRequests On
  ProxyPass /my-project/ http://127.0.0.1:18731/ retry=0
  ProxyPassReverse /my-project/ http://127.0.0.1:18731/ retry=0
  ProxyPreserveHost On
  ProxyErrorOverride Off
  </code></pre>
  
  <p>I do not want to force Django to prefix <code>/my-project/</code> to all of its URLs, in the interest of portability. Apache should apparently be handling the prefix on its own with the <code>ProxyPassReverse</code> line. What am I doing wrong?</p>