From 0ff61c2cd1ac3e1c5ecd2245618cc18d307a981e Mon Sep 17 00:00:00 2001 From: jacy <18049821889@163.com> Date: Sun, 30 Aug 2026 15:50:22 +0800 Subject: [PATCH] =?UTF-8?q?chore(deploy):=20shop/partner/admin=20=E7=A6=81?= =?UTF-8?q?=E6=AD=A2=E6=90=9C=E7=B4=A2=E5=BC=95=E6=93=8E=E6=8A=93=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nginx 直出 robots.txt 并加 X-Robots-Tag,避免内部三端被收录。 Co-authored-by: Cursor --- apps/admin-web/index.html | 1 + apps/admin-web/public/robots.txt | 2 ++ apps/h5-partner/index.html | 1 + apps/h5-partner/public/robots.txt | 2 ++ apps/h5-shop/index.html | 1 + apps/h5-shop/public/robots.txt | 2 ++ deploy/nginx-dukang-staging.conf | 4 ++++ deploy/nginx-dukanghaoke.conf | 4 ++++ deploy/nginx-no-crawler.conf | 11 +++++++++++ 9 files changed, 28 insertions(+) create mode 100644 apps/admin-web/public/robots.txt create mode 100644 apps/h5-partner/public/robots.txt create mode 100644 apps/h5-shop/public/robots.txt create mode 100644 deploy/nginx-no-crawler.conf diff --git a/apps/admin-web/index.html b/apps/admin-web/index.html index b65b325..444c643 100644 --- a/apps/admin-web/index.html +++ b/apps/admin-web/index.html @@ -3,6 +3,7 @@ + 杜康好客 · HQ 管理后台 diff --git a/apps/admin-web/public/robots.txt b/apps/admin-web/public/robots.txt new file mode 100644 index 0000000..1f53798 --- /dev/null +++ b/apps/admin-web/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/apps/h5-partner/index.html b/apps/h5-partner/index.html index c5fba1d..4998d25 100644 --- a/apps/h5-partner/index.html +++ b/apps/h5-partner/index.html @@ -3,6 +3,7 @@ + 城市合伙人 diff --git a/apps/h5-partner/public/robots.txt b/apps/h5-partner/public/robots.txt new file mode 100644 index 0000000..1f53798 --- /dev/null +++ b/apps/h5-partner/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/apps/h5-shop/index.html b/apps/h5-shop/index.html index efe4b31..446ed46 100644 --- a/apps/h5-shop/index.html +++ b/apps/h5-shop/index.html @@ -3,6 +3,7 @@ + 门店管理中心 diff --git a/apps/h5-shop/public/robots.txt b/apps/h5-shop/public/robots.txt new file mode 100644 index 0000000..1f53798 --- /dev/null +++ b/apps/h5-shop/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: / diff --git a/deploy/nginx-dukang-staging.conf b/deploy/nginx-dukang-staging.conf index 318d536..f69078e 100644 --- a/deploy/nginx-dukang-staging.conf +++ b/deploy/nginx-dukang-staging.conf @@ -104,6 +104,7 @@ server { client_max_body_size 50m; include /opt/dukang-staging/deploy/nginx-mp-verify-staging.conf; + include /opt/dukang-staging/deploy/nginx-no-crawler.conf; location /api/ { proxy_pass http://127.0.0.1:8190; @@ -142,6 +143,7 @@ server { client_max_body_size 50m; include /opt/dukang-staging/deploy/nginx-mp-verify-staging.conf; + include /opt/dukang-staging/deploy/nginx-no-crawler.conf; location /api/ { proxy_pass http://127.0.0.1:8190; @@ -179,6 +181,8 @@ server { client_max_body_size 50m; + include /opt/dukang-staging/deploy/nginx-no-crawler.conf; + location /api/ { proxy_pass http://127.0.0.1:8190; proxy_http_version 1.1; diff --git a/deploy/nginx-dukanghaoke.conf b/deploy/nginx-dukanghaoke.conf index ea7b433..c6d519e 100644 --- a/deploy/nginx-dukanghaoke.conf +++ b/deploy/nginx-dukanghaoke.conf @@ -94,6 +94,7 @@ server { client_max_body_size 50m; include /opt/dukang/deploy/nginx-mp-verify.conf; + include /opt/dukang/deploy/nginx-no-crawler.conf; location /api/ { proxy_pass http://127.0.0.1:8090; @@ -132,6 +133,7 @@ server { client_max_body_size 50m; include /opt/dukang/deploy/nginx-mp-verify.conf; + include /opt/dukang/deploy/nginx-no-crawler.conf; location /api/ { proxy_pass http://127.0.0.1:8090; @@ -169,6 +171,8 @@ server { client_max_body_size 50m; + include /opt/dukang/deploy/nginx-no-crawler.conf; + location /api/ { proxy_pass http://127.0.0.1:8090; proxy_http_version 1.1; diff --git a/deploy/nginx-no-crawler.conf b/deploy/nginx-no-crawler.conf new file mode 100644 index 0000000..7e8ffd4 --- /dev/null +++ b/deploy/nginx-no-crawler.conf @@ -0,0 +1,11 @@ +# 禁止搜索引擎抓取(shop / partner / admin,含测试域) +# 合规爬虫读 robots.txt;X-Robots-Tag 覆盖不先读 robots.txt 的抓取器 + +add_header X-Robots-Tag "noindex, nofollow, noarchive" always; + +location = /robots.txt { + default_type text/plain; + charset utf-8; + add_header X-Robots-Tag "noindex, nofollow, noarchive" always; + return 200 "User-agent: *\nDisallow: /\n"; +}