facing error while installing nginx on ubuntu?

Posted November 28, 2021 120 views

when i run command sudo nginx -t then im getting this error

ubuntu nginx: [emerg] unknown directive “” in /etc/nginx/sites-enabled/default:48

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @sharsh2106,

The [emerg] unknown directive error message, means that you’ve added a line that doesn’t mean anything to Nginx in /etc/nginx/sites-enabled/default on line 48.

What I’ll suggest you to do is open the file on this line and see what is there, maybe there is a typo.

If you are not sure, you can post the content of the file here and we’ll try to further advise you.