title: configure nginx to make a background request
body: <p>I am building an application where I need to do some analytics on the api-data combination usage.
  Below is my nginx configuration - </p>
  
  <pre><code>location /r/ {
      rewrite /r/(.*)$ http://localhost:3000/sample/route1/$1 redirect;
      post_action /aftersampleroute1/$1;
  }
  location /aftersampleroute1/ {
      rewrite /aftersampleroute1/(.*) /stats/$1;
      proxy_pass http://127.0.0.1:3000;
  }
  </code></pre>
  
  <p>location <code>/r/</code> is used to redirect the browser request <code>http://localhost:80/r/quwjDP4us</code> to api <code>/sample/route1/quwjDP4us</code> which uses the id <code>quwjDP4us</code> to do something.
  Now in the background I want to pass the id <code>quwjDP4us</code> to an stats api <code>/stats/quwjDP4us</code> which updates the db record for that id.</p>
  
  <p>When I start nginx and make the request <code>http://localhost:80/r/quwjDP4us</code> nginx successfully redirects my request to my application but doesn't make the 2nd request in the background to the stats api. What am I missing?</p>
  
  <p>Note - <code>post_action</code> is not included in nginx docs, is there an alternate module/directive I can use?</p>