Domain Setup (Wix + Elastic Beanstalk)
Scenario: subdomain
api.yourdomain.comhosted on Elastic Beanstalk with DNS managed by Wix.
Prerequisites
- ✅ Elastic Beanstalk environment
 - ✅ EB region defined (ACM certificates must be in the same region as EB)
 - ✅ Domain registered and configured on Wix
 
Terms
- CNAME (Canonical Name): DNS record that points a subdomain to another domain. Example: api.yourdomain.com → my-app.elasticbeanstalk.com
 - ACM (AWS Certificate Manager): AWS service for creating and managing free SSL/TLS certificates
 - SSL/TLS Certificate: Digital certificate that enables secure HTTPS connections
 - DNS Validation: Certificate validation method through DNS records (more common than email validation)
 
1) Create certificate in AWS Certificate Manager (ACM)
- Access ACM in the same region as your Elastic Beanstalk
 - Click Request a certificate → Public certificate
 - Domain name: 
api.yourdomain.com(orapi-dev.yourdomain.com,api-prod.yourdomain.com, etc.) - Validation method: DNS validation (recommended)
 - Complete and copy the generated validation CNAMEs (host/value)
 
⚠️ Why do this first? These CNAMEs will be created in DNS (Wix) to validate the certificate before attaching it to Elastic Beanstalk.
2) Configure DNS in Wix
Access Domains → Manage DNS in the Wix panel and add:
2.1) ACM validation CNAME(s)
- Type: CNAME
 - Host: as shown in ACM (long/unique name generated by AWS) - remove trailing dot (.) if present
 - Points to: the validation CNAME value provided by ACM - remove trailing dot (.) if present
 - Save and wait for validation (typically 3-10 minutes)
 
⚠️ Important: AWS generates values with trailing dots (.), but Wix doesn't accept them. Remove the trailing dot from both Host and Value before saving.
2.2) Application CNAME
- Type: CNAME
 - Host: 
api(or any desired subdomain:api-dev,api-prod, etc.) - Points to: Elastic Beanstalk endpoint
Example:my-app-env.eba-xyz123.eu-west-1.elasticbeanstalk.com 
3) Attach certificate in Elastic Beanstalk
- 
In Elastic Beanstalk → your environment → Configuration → Network
 - 
Add HTTPS listener:
- Port: 443
 - Protocol: HTTPS
 - SSL certificate: select the validated ACM certificate
 - SSL policy: the latest one, example: ELBSecurityPolicy-TLS13-1-2-2021-06
 
 - 
Configure HTTP → HTTPS redirect (optional but recommended):
- Edit the port 80 (HTTP) listener
 - Configure a Redirect rule to 
HTTPS:443 - This forces all connections to use HTTPS
 
 - 
Apply configurations and wait for deployment (may take a few minutes)
 
4) Django application adjustments
# settings.py
ALLOWED_HOSTS = [
    "api.yourdomain.com",  # or your chosen subdomain
]
Deploy: After changes, deploy the application to Elastic Beanstalk.
5) Testing and verification
5.1) Verify DNS
dig api.yourdomain.com
Expected result:
api.yourdomain.com.  300  IN  CNAME  my-app-env.eba-xyz123.eu-west-1.elasticbeanstalk.com.
5.2) Verify HTTPS/TLS
curl -I https://api.yourdomain.com
Expected result:
HTTP/2 200
server: nginx/1.20.1
date: Fri, 05 Sep 2025 10:30:00 GMT
content-type: text/html; charset=utf-8
5.3) Test in browser
- Verify that the certificate is valid - status Issued
 - Access 
https://api.yourdomain.comin the browser 
Workflow summary
- ACM: Create certificate with DNS validation
 - Wix DNS: Add validation CNAMEs + application CNAME
 - Elastic Beanstalk: Attach certificate and configure HTTPS listeners
 - Django: Adjust ALLOWED_HOSTS and proxy configurations
 - Test: Verify DNS, HTTPS, and complete functionality