Report this

What is the reason for this report?

How to set up server blocks for docker droplet?

Posted on December 3, 2020

I want to enable HTTPS on my droplet, so i followed these instructions, which state as a pre-requisite that i needed to install nginx and set up server blocks using these instructions.

when trying to set up server blocks following the 2nd set of instructions, every time i get to sudo systemctl restart nginx i get the following error: Job for nginx.service failed because the control process exited with error code.

Since my droplet is a web app running off an app in a docker conatainer, i won’t have any html files to add or any pages to my site. should i be setting up the server block differently than in the example?



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.

Hi there @brendang,

It sounds like that there could be another service listening on port 80 already so Nginx is failing to start.

In order to verify if this is the case, I would recommend checking your Nginx error log.

  1. tail -f /var/log/nginx/error.log

Also I would suggest following the steps here on how to troubleshoot common Nginx problems:

https://www.digitalocean.com/community/questions/how-to-troubleshoot-common-nginx-issues-on-linux-server

Regards, Bobby

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.