title: Nginx proxy and remove proxy_pass prefix
body: <p>i want use nginx location proxy my applications</p>
  
  <pre><code>nginx(ip address) : 10.255.1.10
  php(10.255.1.20)
  </code></pre>
  
  <p>Ip access:</p>
  
  <pre><code>10.255.1.20/            "access ok(200)"
  10.255.1.20/api        "access ok(200)"
  10.255.1.20/project    "access ok(200)"
  </code></pre>
  
  <p>but i use nginx proxy access 404 </p>
  
  <pre><code>example.com/work      "access ok(200)"
  example.com/work/api  "access not found(404)"
  example.com/work/project  "access not found(404)"
  </code></pre>
  
  <p>Nginx ConfigFile:</p>
  
  <pre><code>server {
      listen 80;
      server_name example.com;
  
      location /work/ {
          proxy_pass              http://10.255.8.77:8065/;
          proxy_set_header        X-Real-IP $remote_addr;
          proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header        X-Forwarded-Proto $scheme;
          proxy_set_header        HOST $host/work;
          proxy_read_timeout      90;
      }
    }
  </code></pre>
  
  <p>i want this:</p>
  
  <pre><code>"curl http://example.com/work          200"
  "curl http://example.com/work/api      200"
  "curl http://example.com/work/project  200" 
  </code></pre>
  
  <p>thanks for everybody.</p>