admin管理员组

文章数量:1560444

在server {} 块中添加下面的配置

 

    location =/robots.txt {
        default_type text/html;
        add_header Content-Type "text/plain; charset=UTF-8";
        return 200 "User-Agent: *\nDisallow: /";
    }

 

在线测试robots.txt是否生效

https://ziyuan.baidu/robots/index

 

robots.txt文件生产工具:http://tool.chinaz/robots/

 

其他网站参考:

https://www.tmall/robots.txt

https://www.jd/robots.txt

https://www.qq/robots.txt

 

转载于:https://wwwblogs/linkenpark/p/10853147.html

本文标签: 蜘蛛搜索引擎NginxrobotsTXT