Question

How to set up server blocks for docker droplet?

Posted December 3, 2020 305 views
NginxDockerUbuntu 20.04

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?

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.

×
Submit an Answer
1 answer

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.

  • 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