You use PHP FPM (Fast CGI) behind Nginx, so you run multiple PHP-FPMs each with their own PHP version. This falls out of stock Debian/Ubuntu already and can be easily extended to even most recent and older PHP versions through PHP Debian Maintainer Ondrejs PPA. Currently PHP 7.0 - 7.4 and 8.0 available via apt-get