Setting up API endpoint and Nginx

Using advance template and created new app ‘api’ specifically for api endpoint.
I’ve been having problem setting up nginx. I’ve googled but can’t find resource to make it work.

Here’s the scenario. Main web site, eg, points to frontend. I’d like to config point to api.

Any idea?