简体   繁体   English

我可以将请求从Kong服务器转发到我自己的servlet吗?

[英]Can I forward the request from Kong server to my own servlet?

I added my api to Kong like 我将我的api像

curl -i -X POST \
 --url http://localhost:8001/apis/ \
 --data 'name=nirmal2' \
 --data 'target_url=http://localhost:8080/switch/apikongcall.do' \
 --data 'public_dns=mockbin10.com'

targer url is my servlet running on apache tomcat targer url是我在apache tomcat上运行的servlet

When I am trying to verify whether kong is hitting my servlet like 当我尝试验证kong是否像我的servlet一样

curl -i -X GET \
 --url http://localhost:9023/ \
 --header 'Host: mockbin10.com'

It can not recognize the resource. 它无法识别资源。 Should'nt it hit my servlet? 它不应该打我的servlet吗?

In your last command, are you sure the Kong API port is running on 9023 ? 在最后一条命令中,您确定Kong API端口正在9023上运行吗?

By default it runs on 8000 : 默认情况下,它在8000运行:

Try with: 尝试:

curl -i -X GET \
 --url http://localhost:8000/ \
 --header 'Host: mockbin10.com'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM