linux: the IIS option "Convert to application" is equivalent or alternative in Apache / Nginx

IIS has an option that allows you to convert a directory of a website into an individual application.

This is very useful in cases where you have a web application, say in NodeJS and you would like the main folder to be dedicated to the NodeJS application, but you also have to have a smaller application in PHP that, for SEO reasons, should run in a subdirectory.

My question is, what are the options to do something similar on a website that has been configured on an Apache or Nginx server on a Linux / BSD server operating system?