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
Scroll to top