有没有办法将“X-Robots-Tag:noindex”标头添加到 Azure CDN 上提供的 pdf 文件中

发布时间:2021-03-08 16:30

只是想知道是否有办法将“X-Robots-Tag:noindex”标签专门添加到通过 azureedge CDN url 从 azure blob 存储提供的 PDF 中。例如 -

Blob 存储 URL - {subdomain}.blob.core.windows.net/container/test.pdf

CDN URL - {subdomain}.azureedge.net/container/test.pdf

我在某些地方读到过,一种方法是将 robots.txt 文件添加到 blob 存储上的 $root 容器并设置“禁止:*.pdf”,但是它指出这并不完全可靠,我宁愿设置 X-Robots-Tag 标头。在 azure 门户中有没有办法设置它,以便通过 blob 或 CDN url 请求的任何“*.pdf”文件自动将此标头添加到响应中?

非常感谢

回答1

您可以在此处找到 CDN 规则引擎(我使用的是标准 Microsoft 层):

enter image description here

测试结果:

enter image description here