Skip to content

Commit

Permalink
feat(ws/entrypoint): disallow robots
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm committed Jan 22, 2024
1 parent de13596 commit acb6b50
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions nginx-ws/etc/nginx/entrypoint.d/40-disallow-robots.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

set -eu

# replace the default robots.txt with a disallow all
disallow_robots() {
if [ ${NGINX_DISALLOW_ROBOTS:-} == 1 ]; then
cat <<EOF > $NGINX_DOCUMENT_ROOT/robots.txt
User-agent: *
Disallow: /
EOF
fi
}

disallow_robots

exit 0

0 comments on commit acb6b50

Please sign in to comment.