Adding redirect for 80 which was causing issues on folder path calls to nginx

This commit is contained in:
2023-02-14 18:52:23 -08:00
parent f973c67bb4
commit 321734a453
2 changed files with 24 additions and 2 deletions

View File

@@ -31,6 +31,21 @@ resource "aws_lb_target_group" "shockrah_xyz" {
}
}
resource "aws_lb_listener" "http" {
load_balancer_arn = aws_lb.alpha.arn
port = 80
protocol = "HTTP"
default_action {
type = "redirect"
redirect {
port = 443
protocol = "HTTPS"
status_code = "HTTP_301"
}
}
}
resource "aws_lb_listener" "https" {
load_balancer_arn = aws_lb.alpha.arn
port = 443