From 5d63941187c0ed295a557d56fa8354b5c776554f Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Mon, 22 Jan 2024 16:11:35 +0330 Subject: [PATCH] feat(pwa/entrypoint): disallow robots --- .../nginx/entrypoint.d/40-disallow-robots.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 nginx-pwa/etc/nginx/entrypoint.d/40-disallow-robots.sh diff --git a/nginx-pwa/etc/nginx/entrypoint.d/40-disallow-robots.sh b/nginx-pwa/etc/nginx/entrypoint.d/40-disallow-robots.sh new file mode 100755 index 0000000..26e9d20 --- /dev/null +++ b/nginx-pwa/etc/nginx/entrypoint.d/40-disallow-robots.sh @@ -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 < $NGINX_DOCUMENT_ROOT/robots.txt +User-agent: * +Disallow: / +EOF + fi +} + +disallow_robots + +exit 0