Nginx

Install Nginx

sudo apt update && sudo apt install -y nginx

$[ip]$

navigate the browser to your server ip will shows the default page.

http://$ip$/ 

Here is the file system location of the default page

ls /var/www/html/

Test Config

sudo nginx -t

Run command as user www-data

The nginx runs as user www-data, we can run command under that user as nginx does

sudo -u www-data whoami
sudo -u www-data php -i | grep _SERVER

Create a special user for site content (optional)

Although I now put all the content under ubuntu account, but it is possible to use a special account

$[username]$

sudo adduser --gecos "" --disabled-password $username$
sudo adduser www-data $username$

Remove that special user (optional)

sudo deluser --remove-home $username$

Generate CSR For SSL Certificate (optional)

openssl req -out CSR.csr -new -newkey rsa:2048 -nodes -keyout privatekey.key