After you attach an ACM certificate to an HTTPS listener on your Application Load Balancer, you still receive plain HTTP on port 80 unless you close or redirect it. This guide edits the HTTP listener default rule so browsers receive a redirect to HTTPS.
What does an ALB HTTP redirect do?
The ALB answers http:// with a 301 or 302 and a Location: header pointing at https:// on the same host and path. Clients then load TLS on port 443.
When should you configure this?
After the ACM walkthrough validates DNS and your HTTPS listener is healthy. Complete creating an ALB first if you do not have listeners yet.
Why use placeholders?
Prefer #{host}, #{path}, and #{query} instead of hardcoding one marketing domain so apex and subdomains each upgrade to HTTPS for themselves.
CDN and HSTS
If viewers hit CloudFront first, enforce HTTPS at the CDN as well. After redirects are stable, consider HSTS so browsers prefer HTTPS on future visits.
Keep port 80 for upgrades.
Deleting the HTTP listener makes typed http:// URLs fail instead of redirecting. A redirect on 80 is the usual public-site pattern.
Do not hardcode a single apex host.
Hardcoding one hostname can send all subdomains to the wrong site. Use ALB placeholders for host, path, and query.
Open Load Balancers, select your ALB, then the Listeners and rules tab.
Select the HTTP:80 listener.
Elastic Load Balancing
How It Works
Port 80 is where browsers send plain http:// requests.
Listeners and rules control forward vs redirect vs fixed responses.
HTTPS:443 should already exist with ACM before you cut over redirects.
Console labels vary—use the screenshots as a visual anchor.
Example 2 — Edit the Default Rule
Open the catch-all rule that currently forwards HTTP traffic.
Under Rules, open the default rule (or the catch-all you use for plain HTTP).
Choose Actions → Edit rule (wording may read Edit depending on console version).
Elastic Load Balancing
How It Works
The default rule runs when no higher-priority host/path rule matches.
Editing here changes what every unmatched HTTP request does.
Leave HTTPS rules alone while you only change the HTTP listener.
Path-specific HTTP rules may need the same redirect if you use them.
Example 3 — Redirect to HTTPS with Placeholders
Switch the action from forward to redirect and preserve host, path, and query.
Change the default action from Forward to target group to Redirect to URL.
Set Protocol to HTTPS and Port to 443.
Choose a status code (commonly 301 permanent once you are sure; use 302 while testing).
Prefer #{host} for the host, #{path} for the path, and #{query} for the query string.
Save changes and wait for the listener state to return to active.
Elastic Load BalancingElastic Load Balancing
How It Works
Redirect returns a status + Location instead of proxying to targets.
#{host} keeps each hostname on itself across the upgrade.
301 is for production cutovers; 302 is safer during dry runs.
HTTPS must forward to targets—never redirect 443 back to HTTP or you will loop.
Example 4 — Confirm ALB Security Groups
Clients need both 80 (redirect) and 443 (TLS site).
Open EC2 → Load Balancers, select your ALB, and copy the security group IDs from the Description tab.
Open EC2 → Security Groups, select each ALB security group.
Under Inbound rules, ensure HTTP (80) and HTTPS (443) are permitted from the sources you intend (often 0.0.0.0/0 for public sites; tighten later with WAF or allow lists).
How It Works
Port 80 must stay open so clients can receive the redirect response.
Port 443 must stay open so the upgraded HTTPS request succeeds.
Target security groups still need to allow the ALB on the app port.
Public 0.0.0.0/0 is common for websites; lock down admin-only ALBs.
Example 5 — Test the Redirect
Verify status, Location header, and a valid certificate.
Open a browser or run curl -I http://your-domain.example.
Confirm a 301 or 302 with Location: pointing at https:// on the same host and path.
Load the HTTPS URL and verify the certificate is valid for your hostname.
Terminal
curl -I http://your-domain.example
Browser
How It Works
curl -I shows status and headers without downloading the body.
Location must use https:// and the expected host/path.
Certificate errors mean ACM/DNS issues on 443, not the redirect itself.
Most redirect bugs are hardcoded hosts, missing SG rules, or HTTPS looping back to HTTP.
host
Hardcoded apex in the redirect
Subdomains jump to the wrong site. Use #{host} so each hostname upgrades to itself.
loop
Redirect loop
HTTPS listener must forward to targets, not redirect back to HTTP. Check both listeners with curl.
sg
Port 80 closed after TLS
Clients never receive the redirect if HTTP is blocked. Keep 80 open for public sites that rely on upgrades.
cert
Redirect works, HTTPS fails
ACM certificate, hostname coverage, or target health on 443 is wrong. Fix TLS before relying on 301s.
cdn
CloudFront in front
Viewer protocol policy may already force HTTPS. Align CDN and ALB so origins and viewers do not fight.
cache
Browsers cache a 301
Use 302 while testing. After a mistaken 301, clear cache or use a private window to retest.
Remember
Key Takeaways
HTTP:80 default action becomes a redirect to HTTPS:443 once TLS is healthy.
Placeholders for host, path, and query keep every hostname correct.
Security groups: allow both 80 and 443 on the ALB.
Test with curl -I, then lock in 301 when HTTPS looks good.
One line: HTTP:80 redirects to HTTPS:443 with #{host}/#{path}, while 443 keeps forwarding.
Frequently Asked Questions
Add or edit a rule on the HTTP listener (port 80) so the default action is a redirect to HTTPS on port 443, using the host and path placeholders the ALB provides. Ensure an HTTPS listener exists with a valid certificate and that security groups allow inbound TCP 80 and 443 from clients.
301 Moved Permanently tells browsers and caches the HTTPS URL is canonical. 302 Found is temporary. Most production cutovers use 301 once you are confident the HTTPS site is correct.
Hardcoding a single hostname in the redirect can break subdomains or multiple alternate domain names on the same ALB. Using ALB placeholders such as #{host} and #{path} keeps each incoming hostname mapped to itself on HTTPS.
If you delete the HTTP listener, many clients that type http:// will fail instead of being upgraded. Keeping port 80 with a redirect is the usual pattern for public sites.
Yes. Ensure the HTTPS listener forwards to targets and does not redirect back to HTTP. Test with curl verbose output or browser devtools network panel when you change rules.
If viewers hit CloudFront first, you often terminate TLS and enforce HTTPS at the CDN, then connect to the origin over HTTPS. The ALB redirect pattern still matters for direct ALB access and for origins behind CloudFront when you allow HTTP from the CDN only.