Domains with dash

I’m having issues with obtaining certificates for domains using a dash in the middle of it.

[root@ip158 conf.d]# certbot --nginx --domains test-domain.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for test-domain.com
Cleaning up challenges
nginx: [warn] conflicting server name “www.test-domain.com” on 0.0.0.0:443, ignored
nginx: [warn] conflicting server name “test-domain.com” on 0.0.0.0:443, ignored
An unexpected error occurred:
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc2 in position 214: ordinal not in range(128)
Please see the logfiles in /var/log/letsencrypt for more details.
[root@ip158 conf.d]#

I have tried to use the “-d” parameter as well as putting the domain name in “” or in ‘’ but doesn’t work. The nginx configuration doesn’t contain any invalid characters since for the domain names without dash proceeding just fine. Can somebody advise here?

Thanks!

Can you please upload the exact nginx configuration as it exactly exists on your filesystem?

One way is to send it to a pastebin like this:

nginx -T | nc termbin.com 9999

Indeed, there were some invalid characters due to paste in the domain names. Thanks for pointing out to it. All good now, topic can be closed.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.