Report this

What is the reason for this report?

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

Posted on April 1, 2016

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.



This textbox defaults to using Markdown to format your 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.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.