Dockererized Kong on windows giving "An invalid response was received from the upstream server" Dockererized Kong on windows giving "An invalid response was received from the upstream server" docker docker

Dockererized Kong on windows giving "An invalid response was received from the upstream server"


I think you're running into the classic IP/Host issue you get when you start out with Docker. The key here is that you must pay attention to making your dockerized Kong be able to reach your localhost from inside the docker container. The issue here is (most likely) that Kong (inside docker) tries to access http://localhost:8080. But for Kong, that's the container it is running on itself.

To do this kind of testing, you will have to find the IP address of your local machine and add that as the upstream_url. Depending on where your machine is, in a home network, or in a corporate network, that will be something like 10.x.y.z, or 192.168.x.y. The command ifconfig (macOS) or ipconfig (Windows) will help you find that address. By using this IP instead, Kong will now be able to resolve your local computer's port 8080, instead of going to its own port 8080.

Please note that this means that you need to reconfigure the API in Kong each time you change IP address of your machine. Depending on whether it's a laptop, or if you use DHCP or such, this will be more or less often.


tl;dr: The upstream URL has to be an URL which enables Kong to resolve the target as seen from inside the Docker container.