How do I serve some requests from a different PHP front controller?

Most of the requests for my app are served from public/index.php, but I want to serve requests to /api from public/sites/api/api.php. Is this possible on

Yes! In your, you’ll want to declare an additional location block for /api, and include the directory that it should reference in the root key and the front controller for the site in the index key:

            root: 'public'
            passthru: '/index.php'
                # Allow access to common static files.
                    allow: true
            root: 'public/sites/api'
            index: ['api.php']
            allow: true
            scripts: true