nginx robots 写到nginx配置文件中

To quickly serve a robots.txt from Nginx without actually having access to the physical file you can define the content of the robots.txt file in the Nginx .conf file.

Allow access to all User-agents:

location = /robots.txt {return 200 “User-agent: *\nDisallow:\n”;}

Disallow access to every User-agent:

location = /robots.txt {return 200 “User-agent: *\nDisallow: /\n”;}

如果没有加=号 会出现回复返回的问题

相关:

  • wedk2
  • sadxme
  • robots文件 nginx
  • robots txt nginx
  • presentfzj
  • nginx,rotbots
  • nginx 配置文件 robots
  • fars8y
  • coverbgq
  • arrangement6zi

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据

Scroll to top