how to use nginx as reverse proxy for cross domains
<p>I need to achieve below test case using nginx:</p>

<p><code>www.example.com/api/</code> should redirect to <code>ABC.com/api</code>,
while <code>www.example.com/api/site/login</code> should redirect to <code>XYZ.com/api/site/login</code></p>

<p>But in the browser, user should only see <code>www.example.com/api....</code> (and not the redirected URL).</p>

<p>Please let me know how this can be achieved.</p>