Now Hiring: Are you a driven and motivated 1st Line IT Support Engineer?

Blog

nginx robots 写到nginx配置文件中

博客

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”;}

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

Leave your thought here

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

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare