title: Django app has wrong urls when configured on nginx+uwsgi with subpath
body: <p>I am trying to configure nginx and uwsgi to serve django (wagtail to be exact) app on <code>/blog</code> subpath. Most answers to this question (like <a href="https://stackoverflow.com/questions/11292217/run-django-app-via-nginxuwsgi-in-a-subpath">this one</a>) suggest using:</p>
  
  <pre><code>location /blog {
      include uwsgi_params;
      uwsgi_pass unix:/run/uwsgi/application.sock;
      uwsgi_param SCRIPT_NAME /blog;
      uwsgi_modifier1 30;
  }
  </code></pre>
  
  <p>Unfortunately it does not work for me. Accessing <code>/blog</code> duplicates  subpath and redirects to <code>/blog/blog/</code>. Wagtail then shows its 404 page as <code>/blog/blog/</code> does not exist. I am not sure whether it's nginx or django problem.</p>