Problems with nginx and moodle

Hello there, im new on digitalocean. I am tring to install moodle 3.9. on the server but i have problems with the nginx server, it wont start, theres an error but i cant find it. Ive followed these instructions to step by step for installing moodle, but on the last step where i make the last changes on the server configuration file and when i wanna restart the nginx service then im getting an error. These instructions:

Can please someone help me or give me an advice how to solve this problem?

P.S. ive uploaded some screenshots about the problem and what kind of settings i have.

Hope i solve this soon.

ScreenShots are uploaded on

Submit an answer
Answer a question...

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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
November 16, 2020
Accepted Answer

Hi there @pa3k,

From the first image, I can see that you have Apache installed as well. Note that you can have only one service listening on the same port. So it is not possible to have Apache and Nginx running on the same ports.

What you need to do is stop and remove Apache completely and only run Nginx.

For more information on how to troubleshoot common Nginx problems, I could suggest going through this answer here:

Regards, Bobby

Hi @pa3k,

in case you haven’t found a working solution yet, I suggest you try out the 1-click Moodle installation from DO Marketplace!

We’re maintaining it up-to-date with the latest Moodle version and support it all the way through.