Docker: Let's Encrypt Error "Domain Name Contains an Invalid Character"
This documentation is part of the HTTPS Routing guide. You can view the complete guide here: How to manage HTTP routing and TLS encryption (HTTPS) in your Docker containers.
Welcome to the Stackhero documentation
Stackhero offers a ready-to-use Docker cloud CaaS (Containers as a Service) platform, designed for fast and reliable container deployments:
- Deploy to production with a single
docker-compose upcommand. No additional configuration required: just launch your containers.- Choose your own domain name, automatically secured with HTTPS (for example: https://api.your-company.com, https://www.your-company.com, or https://backoffice.your-company.com).
- Take advantage of high performance and enhanced security on private, dedicated infrastructure.
- Apply updates with a single click for simple, effortless maintenance.
Your containers can be running in production in about five minutes. Stackhero manages the infrastructure, updates, and security for you, so you can focus on developing your applications. Learn more about Docker CaaS cloud hosting.
When creating a subdomain, Let's Encrypt follows RFC 952 and 1123, which allow only characters in the set [a-zA-Z0-9-].
Although underscores ('_') are permitted in DNS record names, they are not acceptable in hostnames. As a result, Let's Encrypt rejects subdomains such as "my_subdomain.example.com" and displays the error "Domain name contains an invalid character".
To resolve this issue, simply remove any underscores from your subdomains.