I\'ve just recently moved my websites from apache2 to Nginx as my new web server backend. got to love problems aha.
HTML files in the web host director work prior to php
If u are running latest PHP version
PHP version
e.g `php7.4`
then sudo apt-get install php7.4-fpm and then sudo service nginx restart sudo service php7.4-fpm restart. Also remember to change the name in the /etc/nginx/site-enable/example.com as well
sudo apt-get install php7.4-fpm
sudo service nginx restart
sudo service php7.4-fpm restart
/etc/nginx/site-enable/example.com