Trying to install Comodo SSL cert and get "nginx: [emerg] "server" directive is not allowed here"

I’ve tried editing both /etc/nginx/sites-enabled and /etc/nginx/nginx.conf to no avail, i get the same error every time!

What’s going wrong here?

I’m on Ubuntu 14.04.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

You’ve got a server {...} block in the wrong spot, paste your nginx.conf and relevant files from sites-enabled and I’ll try to help you fix it.