Skip to main content
10 min Configure custom domains with automatic Let’s Encrypt SSL certificates for secure HTTPS access to your Decision Control deployment.

Overview

Both Sandbox and Production editions support automatic SSL/HTTPS configuration using:
  • Custom Domains: Use your own subdomain (e.g., decision-control.example.com)
  • Route 53 Integration: Automatic DNS record creation
  • Let’s Encrypt: Free SSL certificates with auto-renewal
  • nginx Reverse Proxy: HTTPS termination on port 443
  • HTTP Redirect: Automatic redirect from HTTP to HTTPS

Prerequisites

Before configuring SSL/HTTPS, you need:
  1. Route 53 Hosted Zone: You must own a domain with a hosted zone in AWS
  2. Example: example.com. (note the trailing dot)
  3. The hosted zone must exist in the same AWS account
  4. Public Subnet: Instance must have a public IP for Let’s Encrypt validation
  5. Port 80 Access: Security group must allow HTTP from 0.0.0.0/0 for Let’s Encrypt challenge
  6. This is temporarily required for certificate validation
  7. HTTPS (port 443) can be restricted to your IP/CIDR

Configuration During Deployment

When creating your CloudFormation stack, provide these optional parameters:

Custom Domain Parameters

CustomDomain:
  • The subdomain prefix for your application
  • Do NOT include the full domain name
  • Example: decision-control (not decision-control.example.com)
  • Valid characters: lowercase letters, numbers, hyphens
  • Must start with a letter
HostedZoneName:
  • Your Route 53 hosted zone name
  • Must include the trailing dot (.)
  • Example: example.com. (not example.com)
  • Must match an existing hosted zone in your AWS account

Example Configuration

For a final URL of https://app.mycompany.com/:

What Happens Automatically

When you provide custom domain parameters, the deployment automatically:
  1. Creates Route 53 A Record: decision-control.example.com → Instance Public IP
  2. DNS propagation takes 1-5 minutes
  3. Waits for DNS Resolution: Application startup waits for DNS to propagate
  4. Obtains Let’s Encrypt Certificate: Using HTTP-01 challenge
  5. Let’s Encrypt validates domain ownership via HTTP
  6. Certificate valid for 90 days
  7. Free certificate from trusted CA
  8. Configures nginx: Reverse proxy setup
  9. HTTPS on port 443 → Application on port 8080
  10. HTTP on port 80 → Redirects to HTTPS
  11. Enables Auto-Renewal: Daily cron job checks for renewal
  12. Automatically renews 30 days before expiration
  13. Zero downtime renewal process

Security Group Requirements

For Let’s Encrypt HTTP-01 Challenge

The security group must allow HTTP access from the internet for Let’s Encrypt validation: During Deployment (Required for certificate issuance):
After Certificate is Issued (Optional - More Secure):
Port 80 MUST be accessible from 0.0.0.0/0 during initial certificate issuance and renewals. Let’s Encrypt validation servers need to reach http://your-domain.com/.well-known/acme-challenge/TOKEN.

How Let’s Encrypt Validation Works

The HTTP-01 challenge process:
  1. Certificate Request: Your instance requests a certificate from Let’s Encrypt
  2. Challenge Issued: Let’s Encrypt provides a unique token
  3. Token saved to: /var/www/html/.well-known/acme-challenge/TOKEN
  4. Validation Request: Let’s Encrypt makes HTTP request
  1. nginx Serves Challenge: nginx serves the token file on port 80
  2. Certificate Issued: Let’s Encrypt validates ownership and issues certificate
  3. Certificate stored in /etc/letsencrypt/live/decision-control.example.com/
  4. nginx Reconfigured: HTTPS enabled, HTTP redirects to HTTPS

Testing Your HTTPS Deployment

Verify DNS Resolution

Test HTTP Redirect

Test HTTPS Connection

Verify Certificate

Certificate Auto-Renewal

Certificates automatically renew via daily cron job:

Renewal Configuration

Cron Job: /etc/cron.daily/certbot-renew
Renewal Timing:
  • Checks daily at 2:00 AM local time
  • Renews when 30 days or less remain
  • Zero downtime (nginx reload, not restart)

Manual Renewal (Testing)

To manually test renewal:

Troubleshooting SSL/HTTPS Issues

Issue: Certificate Validation Fails

Symptoms:
Causes:
  1. Port 80 not accessible from internet
  2. DNS not resolving correctly
  3. Security group blocking Let’s Encrypt servers
Solutions:

Issue: DNS Not Resolving

Symptoms:
Causes:
  1. Route 53 hosted zone doesn’t exist
  2. Hosted zone name mismatch
  3. DNS propagation delay
Solutions:

Issue: Certificate Expired

Symptoms:
Causes:
  1. Auto-renewal cron job not running
  2. Port 80 blocked during renewal
  3. DNS changed after deployment
Solutions:

Issue: nginx Not Starting

Symptoms:
Causes:
  1. Certificate files not found
  2. Incorrect file permissions
  3. nginx configuration error
Solutions:

Advanced SSL Configuration

Using Your Own SSL Certificate

If you prefer to use your own SSL certificate instead of Let’s Encrypt:
  1. SSH to Instance:
  1. Upload Certificate Files:
  1. Update nginx Configuration:
  1. Test and Reload:

Custom SSL/TLS Settings

Enhance security with custom nginx SSL settings:

Best Practices

  1. Use Custom Domains for Production: Always enable HTTPS for production deployments
  2. Keep Port 80 Open: Required for Let’s Encrypt renewals every 60-90 days
  3. Monitor Certificate Expiration: Let’s Encrypt certificates expire in 90 days
  1. Test Renewal Process: Run dry-run renewals monthly
  1. Use HSTS Headers: Enable HTTP Strict Transport Security (already included)
  2. Plan for DNS Changes: If you change instance IP, update Route 53 A record

Next Steps

Support

For SSL/HTTPS issues: