recently there is a project with completely separate front and rear ends, and the approximate requirements are as follows:
Project path
|-php_project
|-pc_front_project
|-wap_front_project
pc page corresponding domain name whj.domain.com nginx root is set to pc_front_project directory
web corresponding domain name m.whj.domain.com nginx root is set to wap_front_project directory
backend project is located under php_project directory
the api path accessed in the front-end project (pc+web) is in a format similar to api/user/1
how do I use nginx to forward dynamic requests that start with api in a request front-end project to the back-end php project for processing?