Skip to content

Commit

Permalink
Merge pull request #1088 from GSA/exclude-bots
Browse files Browse the repository at this point in the history
exclude bots from tracking
  • Loading branch information
nickumia-reisys authored Oct 2, 2023
2 parents 56d8f1b + fe8a072 commit 3081225
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions proxy/nginx-botbegone.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# prevent top 6 bots from entering data into /_tracking
## Googlebot/
## Y!J
## Yeti
## Bytespider
## Applebot
## HeadlessChrome

set $botstracking 0;

if ($uri = "/_tracking") {
set $botstracking 1;
}

if ($http_user_agent ~ 'Googlebot/|Y!J|Yeti|Bytespider|Applebot|HeadlessChrome') {
set $botstracking "${botstracking}1";
}

if ($botstracking = 11) {
return 200;
}
1 change: 1 addition & 0 deletions proxy/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ http {
server_name {{env "EXTERNAL_ROUTE"}} {{env "PUBLIC_ROUTE"}};

include nginx-cloudfront.conf;
include nginx-botbegone.conf;
include nginx-common.conf;
}

Expand Down

0 comments on commit 3081225

Please sign in to comment.