diff --git a/nginx.conf b/nginx.conf index 1b8bb1b244..4d40e8cad5 100644 --- a/nginx.conf +++ b/nginx.conf @@ -810,6 +810,12 @@ server { resolver 172.20.0.10; server_name ~^(?[^.]+)\.preview\.docs\.apify\.com$; + # Block search indexing on every response from preview hostnames, including the + # apify.github.io proxy_passes (SDK/Client/CLI) that have no preview bucket and + # would otherwise serve production content under the preview hostname. + # `always` keeps the header on 4xx/5xx so error pages aren't indexed either. + add_header X-Robots-Tag "noindex, nofollow, noarchive" always; + # add trailing slashes to the root of GH pages docs rewrite ^/api/client/js$ /api/client/js/ redirect; rewrite ^/api/client/python$ /api/client/python/ redirect;