Follow this steps to configure Nginx.

  1. Create directory in /var/www called
  2. Copy static files in that folder. e.g index.html
  3. cd into /etc/nginx/ (nginx configuration files)
  4. Create file called in sites-available directory.
  5. Add following text to it
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/;
index index.html;
location / {
try_files $uri $uri/ =404;

6. Add this file to the sites-enabled folder

ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

7. sudo systemctl restart nginx