Deploying Nginx + PHP on the Ubuntu server

NGinx-is a quick and easy Web-server, to install it you need to enter several commands in the terminal:

sudo apt update
sudo apt install nginx php-fpm

Check the health of the Web server:

systemctl status nginx

In this case, change the file /etc/nginx/sites-available/default

server {
	listen 80 default_server;
	listen [::]:80 default_server;

	root /var/www/html;

	index index.html index.htm index.php;

	server_name _;

	location / {
		try_files $uri $uri/ =404;
	}

	location ~ \.php$ {
		try_files $uri = 404;
		include /etc/nginx/fastcgi.conf;
		fastcgi_pass unix:/run/php/php7.0-fpm.sock;
	}
}

Next, reboot Nginx

nginx -s reload