Skip to content

Commit

Permalink
feat(pwa/entrypoint): disallow robots
Browse files Browse the repository at this point in the history
  • Loading branch information
njfamirm committed Jan 22, 2024
1 parent acb6b50 commit 5d63941
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions nginx-pwa/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 5d63941

Please sign in to comment.