1

我的电脑上有一个scrapy splash spider 的工作实例。然后我将它迁移到我的linux服务器。蜘蛛工作正常,检索结果没有飞溅。但是对于相同的网站,当我使用启动画面(https://github.com/scrapy-plugins/scrapy-splash)时,我的蜘蛛不会检索任何内容并返回 404 错误。我在我的服务器上设置了 nginx 和 django,我想知道这是否与启动的“SPLASH_URL”设置冲突。

1)我尝试将启动网址更改为以下所有内容:

SPLASH_URL = 'http://localhost:8050/'
SPLASH_URL = 'http://127.0.0.1:80/
SPLASH_URL = '<server ip>:8050/'

我还将端口更改为 80 和 8050

2)从我的服务器运行 curl 时,我得到以下信息

 $ curl http://localhost:80/render.html?url=http%3A%2F%2Fwww.google.com

 <html>
   <head><title>404 Not Found</title></head>
   <body bgcolor="white">
     <center><h1>404 Not Found</h1></center>
     <hr><center>nginx/1.10.0 (Ubuntu)</center>
   </body>
 </html>

什么可能导致 404 错误。如果我使用的是 docker,则启动指令指定将 url 设置为 localhost 或 docker ip。提前非常感谢!

4

1 回答 1

0

我刚刚想通了。原来我的启动服务器由于某些错误而退出。运行docker start <containerId>解决了问题

于 2017-07-10T00:06:45.180 回答