Skip to content

Commit

Permalink
Redirect prod subdomains to fightpandemics.com
Browse files Browse the repository at this point in the history
  • Loading branch information
mannykary committed Jul 14, 2020
1 parent 0ae43c3 commit cf9de70
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions terraform-task-module/alb-listener-rule.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,23 @@ resource "aws_alb_listener_rule" "main" {
values = [var.fp_context == "production" ? "fightpandemics.com" : "${var.subdomain}.*"]
}
}

resource "aws_alb_listener_rule" "redirect" {
count = var.fp_context == "production" ? 1 : 0
listener_arn = data.aws_alb_listener.main.arn
action {
type = "redirect"

redirect {
host = "fightpandemics.com"
port = "443"
protocol = "HTTPS"
status_code = "HTTP_301"
}
}
condition {
host_header {
values = ["*.fightpandemics.com"]
}
}
}

0 comments on commit cf9de70

Please sign in to comment.