title: Can nginx decide whether to proxy to a url, based on a previous proxy call?
body: <p>I have the following situation:</p>
  
  <ol>
  <li>A backend system which is hidden for outside access</li>
  <li>A thin extension, written in Play Framework, which does some external work with the data passed to the backend.</li>
  <li>An nginx instance intercepting all public calls, and deciding to which system to proxy</li>
  </ol>
  
  <p>The idea is the following:
  If a specific call comes, I want nginx to proxy it to the Play app, and based on the result of the Play app, to decide whether to proxy it to the backend, or to return the result of the Play app to the web client. The result of the Play app could be either some JSON, or directly playing with the response codes, so when it can be poxide further, it will return 200, if not 500, etc.</p>
  
  <p>Is it possible?</p>