title: nginx location path with proxy_pass
body: <p>I have following problem, i'm trying to put a Django app with an gunicorn server on my VPS running Nginx. My nginx config looks like this:</p>
  
  <pre><code>upstream app_name {
      server unix:/path/to/socket/file.sock fail_timeout=10;
  }
  
  server {
  
     listen 80 default_server;
     listen[::]:80 default_server ipv6only=on;
     root /webapps/;
     server_name my_hostname.com;
  
     location / {
        proxy_set_header Host $http_host;
  }
  
     location /appname/ {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_redirect off;
  
        proxy_pass http://app_name;
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>However when i navigate to <code>my_server.com/appname/</code> i constantly get 404 error. I'm still new to Nginx, could someone point me in the right direction on how to set the proxy_pass for <code>/appname/</code> path? I should point out that when location for <code>/appname/</code> is replaced with <code>/</code> the django app is running fine.</p>