我想在 nginx 网络服务器上运行 aiohttp 后端服务。两者都应该在 docker 容器中运行。此外,我的前端 Angular 应用程序应该访问我的后端服务。
我希望 nginx 网络服务器可以连接到我在 docker 中运行的后端系统 aiohttp。
当我尝试在我的 aiohttp 后端服务上调用 GET 请求时,我总是在 docker 日志中收到错误消息。
nginx_1 | 2018/09/29 13:48:03 [错误] 6#6:*1 connect() 失败(111:连接被拒绝),同时连接到上游,客户端:172.19.0.1,服务器:,请求:“GET /toolservice/波动性?command=pslist HTTP/1.1”,上游:“ http://172.19.0.2:80/toolservice/volatility?command=pslist ”,主机:“localhost”nginx_1 | 172.19.0.1 - - [29/Sep/2018:13:48:03 +0000] "GET /toolservice/volatility?command=pslist HTTP/1.1" 502 576 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36" "-"
version: '3'
services:
nginx:
build: ./nginx
restart: always
depends_on:
- toolservice
- ifs
ports:
- "80:80"
ifs: …Run Code Online (Sandbox Code Playgroud)