title: nginx reverse proxy a REST service alternate 200 and 404 responses for same uri
body: <p>the nginx.conf:</p>
  
  <pre><code>   server {
      listen 8080;
     }
     server {
      listen       80;
      server_name  localhost;
  
      location / {
          root   /test/public;
          index  index.html index.htm;
      }
  
      location /api {
          proxy_pass http://localhost:8080;
      }
  
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
          root   html;
      }
  }
  </code></pre>
  
  <p>the request and reponse headers are almost plain, no auth/session/cache parameters involved.</p>
  
  <p>For same uri, first request will return successfully, while second will return 404, and so on.
  I've tried disabling proxy buffering, but has no effect.</p>