【发布时间】:2019-10-19 20:33:56
【问题描述】:
我有一个在 http://www.schandillia.com 运行的 NodeJS/NextJS 应用程序。该项目有一个 robots.txt 文件,可通过http://www.schandillia.com/robots.txt 访问。截至目前,该文件是用于测试目的的准系统:
User-agent: *
Allow: /
但是,当我在我的网站上运行 Lighthouse 审核时,它会引发 抓取和索引错误,说它无法下载 robots.txt 文件。我再说一遍,该文件在http://www.schandillia.com/robots.txt 可用。
如果您需要查看该项目的代码库,请访问https://github.com/amitschandillia/proost。 robots.txt 文件位于proost/web/static/,但由于我的 Nginx 配置中的以下内容,可以在根目录下访问:
# ... the rest of your configuration
location = /robots.txt {
proxy_pass http://127.0.0.1:3000/static/robots.txt;
}
完整的配置文件可在 github https://github.com/amitschandillia/proost/blob/master/.help_docs/configs/nginx.conf 上查看。
如果有什么我忽略的地方,请指教。
【问题讨论】:
标签: node.js robots.txt content-security-policy next.js lighthouse