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

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.

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

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.