Skip to content

Commit dacd19e

Browse files
authored
Merge pull request #480 from alphagov/auth-1330-robots
AUTH-1330: Serve `robots.txt` from load balancer
2 parents 815fbcc + 74aad40 commit dacd19e

3 files changed

Lines changed: 20 additions & 1 deletion

File tree

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ COPY package.json ./
44
COPY yarn.lock ./
55
COPY tsconfig.json ./
66
COPY ./src ./src
7-
COPY ./static ./static
87
COPY ./@types ./@types
98
RUN yarn install && yarn build
109

ci/terraform/alb.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,23 @@ resource "aws_alb_listener" "frontend_alb_listener_https" {
4949

5050
tags = local.default_tags
5151
}
52+
53+
resource "aws_alb_listener_rule" "frontend_alb_listener_https_robots" {
54+
listener_arn = aws_alb_listener.frontend_alb_listener_https.arn
55+
priority = 10
56+
57+
action {
58+
type = "fixed-response"
59+
fixed_response {
60+
content_type = "text/plain"
61+
message_body = file("static/robots.txt")
62+
status_code = 200
63+
}
64+
}
65+
66+
condition {
67+
path_pattern {
68+
values = ["/robots.txt"]
69+
}
70+
}
71+
}

0 commit comments

Comments
 (0)