admin管理员组文章数量:1334929
I have a REST API running from a container but the port is published so I can access the web service from any machine using . Everything is good.
Now, I have another application running on a different container on the same host, which should consumes the web service (running in the other container). For some reason, the web service always returns 400 Bad Request when trying to consume from the app in the container...
If trying the app from the same host or outside, it always works! I'm not sure if I 'm missing some configuration, but calling the API from inside a container, shouldn't be the same if using the URL?
I would appreciate any help.
Gus
I have a REST API running from a container but the port is published so I can access the web service from any machine using https://myapi/myservice. Everything is good.
Now, I have another application running on a different container on the same host, which should consumes the web service (running in the other container). For some reason, the web service always returns 400 Bad Request when trying to consume from the app in the container...
If trying the app from the same host or outside, it always works! I'm not sure if I 'm missing some configuration, but calling the API from inside a container, shouldn't be the same if using the https://myapi/myservice
URL?
I would appreciate any help.
Gus
- 400 Bad Request which means that it is hitting a server and it is responding to your request. Could you just be sending an invalid request? – Jason Gallagher Commented Nov 21, 2024 at 2:46
- Please share a minimal reproducible example – OneCricketeer Commented Nov 21, 2024 at 2:54
1 Answer
Reset to default 0For first step,maybe you should check DNS resolution name inside of the container that you're tying to call.
or trying to do the telnet first whether the expected port can be called inside container. Just for crosscheck.
Or better use container port directly to call the other container For example, if the API container is named api-service, you can access it using http://api-service:port/myservice
instead of using public domain
本文标签:
版权声明:本文标题:http - A REST API from inside a container is NOT accessible from other container on the same host - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742317507a2452117.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论