Kong API网关:从上游服务器收到无效响应

时间:2020-08-14 02:41:29

标签: docker flask kong

我正在学习如何使用Kong API Gateway,而我遇到了一些问题(即使用dockerized版本)。

通常我使用此命令通过终端获取信息(testing.co.id不是真实的,我出于私人原因对其进行了更改)

curl --silent --header 'X-SDC-APPLICATION-ID:testing.co.id' --header 'Content-Type: application/json' --request GET http://localhost:5000/user/1

在使用sshuttle打开与数据库的连接时

sshuttle --verbose --remote admin@101.101.221.171 11.71.1.1/16 --ssh-cmd "ssh -i secret_key.pem"

我遵循了文档中的这些步骤

  1. 在Flask中将Flask API注册为服务
curl -i -X POST \
--url http://localhost:8001/services/ \
--data 'name=testApi' \
--data 'url=http://192.168.0.7:5000'
  1. 注册到服务的路线
curl -i -X POST \
--url http://192.168.0.7:8001/services/testApi/routes \
--data 'hosts[]=192.168.0.7' \
--data 'paths[]=/user' \
--data 'strip_path=false' \
--data 'methods[]=GET'
  1. 检查回复
curl -i -X GET \
--url http://192.168.0.7:8000/api/user/1 \
--header 'Host: 192.168.0.7'

而且我不断收到此错误

An invalid response was received from the upstream server.

我在哪里弄错了?

0 个答案:

没有答案