Skip to content

Instantly share code, notes, and snippets.

@mabrizio
Created January 30, 2014 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mabrizio/8716965 to your computer and use it in GitHub Desktop.
Save mabrizio/8716965 to your computer and use it in GitHub Desktop.
Robots disallow robots from CloudFront
if (req.url ~ "^/robots.txt$") {
if (req.http.User-Agent ~ "CloudFront")
{
set obj.http.Content-Type = "text/plain; charset=utf-8";
synthetic {"User-agent: *\nDisallow: /"};
}
return (deliver)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment