Hi,
I’m writing to confirm my implementation of SSL and www.mydomain.com and mydomain.com (i.e. without www) is correct.
I have certs already purchased from name.com. I’ve got those in place and referenced in the default file in the path /etc/nginx/sites-enabled and checked against sudo nginx -t to ensure syntax is ok.
This looks like:
server {
listen 443 ssl;
server_name www.mydomain.com mydomain.com;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_certificate /home/nodeapp/www.mydomain.com.chained.crt;
ssl_certificate_key /home/nodeapp/www.mydomain.com.key;
}
I’ve added by www.mydomain.com and mydomain.com as domains, so dokku domains node app shows:
mydomain.com
www.mydomain.com
The command dokku certs:info mydomain shows the certificate details with:
=====> Common Name(s):
=====> www.mydomain.com
=====> www.mydomain.com
=====> mydomain.com
Then in my Cloudflare DNS settings (where i also have redirect from non www to www with https) I have 2 records:
A record -> mydomain.com -> points to my droplet IP CNAME record -> www -> points to @ - is an alias of mydomain.com
Advice/confirmations would be appreciated.
Many Thanks
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!
In the directory where your server blocks are, do you happen to have an extra file that’s marked with a tilde (~) or a temp file by chance? Or even a dot, or .save, or something of that nature?
From the looks of it, NGINX is trying to load your server block twice and when it does it’s stating that the domain is already loaded from one configuration file so it’s ignoring the second.
If NGINX is setup to load everything from /etc/nginx/sites-enabled, for example, it will attempt to load everything in that directory. So if there’s an extra server block with the same information, you’ll see the logs populated with that error.
Hi,
I did a ls -a at the path /etc/nginx/sites-enabled and there is only file file default.
Anywhere else this I need to be checking?
Could this be because I have 2 domains listed - i.e. if i do dokku domains myapp, i’m presented with www.mydomain.com and mydomain.com?
The issue of “too many redirects” is an issue with CloudFlare. You’ll need to login to the CloudFlare control panel and under their “Crypto” tab, make sure SSL is set to “Full (Strict)” and allow that to take effect.
As for the error log, if you could, please post the full server block(s) so I can take a look at them. You can comment out the domain and/or IP’s if needed.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.