How to set up server blocks for docker droplet?

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?


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.

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:

Regards, Bobby