Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
error duplicate listen options for [::]:443 when trying to add a subdomain to my nginx setup
I followed this DigitalOcean guide on how to setup Nginxon an Ubuntu 18.04 droplet. I set up my domain’s nameservers to point to Cloudflare’s and then based on what I had read previously my understanding that to add a subdomain (blog.faizanjamil.dev in this case) I could simply add a file titled (blog.faizanjamil.dev) to the
/etc/nginx/sites-available (and symlink that file with
Keep in mind I am using Let’s Encrypt
However when I add that file and then try to enable that site, I get the following when running
sudo nginx -t
nginx: [emerg] duplicate listen options for [::]:443 in /etc/nginx/sites-enabled/faizanjamil.dev:20
nginx: configuration file /etc/nginx/nginx.conf test failed
Now the blog.faizanjamil.dev config was created by copying the faizanjamil.dev config and modifying it slightly. With the blog subdomain not included in
sites-enabled nginx produced no errors in the configs.
I have tried the same procedure to create the config for the subdomain twice, no luck. I have shown the below files to a buncha people who then suggested I try a couple different things like removing the
default config from
sites-enabled, no luck.
So can anyone please help with this issue?
Also before I forget I intend to deploy Ghost on that blog subdomain
My nginx.conf, faizanjamil.dev config, default config, and blog.faizanjamil.dev configs are attached in the pastebin links below.
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.×