Install Ngnix Web Server
sudo apt-get install nginx
Controlling Nginx
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl reload nginx
Firewall
sudo ufw allow 'Nginx Full'
sudo ufw reload
Nginx Configuration Directory
cd /etc/nginx
sudo cp nginx.conf nginx.conf.bak
sudo nano nginx.conf
Verify this line is uncommented,
include /etc/nginx/sites-enabled/*;
cd sites-available
sudo nano default
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /home/ravi/www/html;
index index.html;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
Restart Server
sudo systemctl restart nginx