nginx: open() “/var/run/nginx.pid“ failed (2: No such file or directory)

Error description
Installing and configuring NGINX throws the following error

2021/02/23 15:52:26 [error] 9460#9460: open() "/var/run/nginx.pid" failed (2: No such file or directory)

The solution

sudo nginx -c /etc/nginx/nginx.conf
nginx -s reload

Read More: