Since Ubuntu is based on Debian you could always use Ubtuntu repos on Debian via a customized apt source list file, for instance: /etc/apt/sources.list.d/lemp.list
. Then write something like this:
# Import keys for custom software
#wget -q https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
#wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
# Use latest packages from Ubuntu LTS
deb https://nginx.org/packages/mainline/ubuntu/ bionic nginx
deb https://packages.sury.org/php/ buster main
Don't forget to import the keys before running apt update
. However, I'd recommend yo use nginx 16 instead of 17 and php 7.3 instead of 7.4 which are the stable versions of those. Otherwise you'll get some unwanted updates that could break your setup instead of only the security updates you'll want in a production environment.