jetsung nginx 中设置 robots.txt 禁止搜索引擎收录 server { # 其他 server 配置项 location = /robots.txt { add_header Content-Type text/plain; return 200 "User-agent: *\nDisallow: /\n"; } # 其他 location 配置项 } 再使用 nginx -t 校验。没有出错后,再使用重启 nginx。 systemctl reload nginx