Skip to content

Commit

Permalink
fix: redirect static /doc/master on fastly also
Browse files Browse the repository at this point in the history
  • Loading branch information
softmoth committed Sep 24, 2024
1 parent 2936de8 commit 152e7f1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions terragrunt/modules/release-distribution/fastly-static.tf
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,26 @@ resource "fastly_service_vcl" "static" {
VCL
}

snippet {
# This was an abandoned copy of Rust 1.17.0-era docs; redirect to current docs
name = "redirect /doc/master to /stable"
type = "error"
content = <<-VCL
if (req.url ~ "^\/doc/master(\/|$)")?$") {
set obj.status = 301;
set obj.response = "Moved permanently";
set obj.http.Location = regsub(req.url, "^\/doc\/master", "https://doc.rust-lang.org/stable");
synthetic {"
#!/bin/bash
echo "The documentation now lives under doc.rust-lang.org"
"};
return (deliver);
}
VCL
}

logging_datadog {
name = "datadog"
token = data.aws_ssm_parameter.datadog_api_key.value
Expand Down

0 comments on commit 152e7f1

Please sign in to comment.