NGINX

The cleanest and probably the "safest" way to do this part is to generate configuration with Drush, it's amazing how this tool never fails to surprise in the most positive way! Otherwise, check below more extensive example - warning just an example - there is some extra security rules as well as gzip compression etc.

Additionally, there is a Logrotate utilization example.

Install
Code
# Install current stable version.
apt install nginx
# Check Firewall settings.
ufw app list
# Make sure NGINX has full access.
ufw allow 'Nginx Full'
# Confirm firewall status.
ufw status
# Check NGINX status.
systemctl status nginx
Generate server block with Drush
Code
drush generate misc:nginx-virtual-host
Advanced example, Drupal >= 10
Logrotate option