Rewrite subdirectory URL to subdomain in Nginx

I have a droplet with a LEMP stack running a WordPress site. I have also uploaded a non-wordpress PHP app into the same root folder.

The non-wordpress PHP app can be viewed at, but I would like to change the URL to

How can I achieve this with Nginx?