Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

502 when proxying local service #163

Closed
montanaflynn opened this issue Apr 26, 2015 · 6 comments
Closed

502 when proxying local service #163

montanaflynn opened this issue Apr 26, 2015 · 6 comments
Labels

Comments

@montanaflynn
Copy link

I'm trying to have Kong proxy running in docker to a service running on port 4444. Getting a 502 error from openresty.

First I created the API in kong with this command:

 curl -i -X POST \
 --url http://127.0.0.1:8001/apis/ \
 --data 'name=kongdb' \
 --data 'target_url=http://127.0.0.1:4444' \
 --data 'public_dns=kongdb.org'

Then tested it and got this response:

$ curl 127.0.0.1:8000 -H "host: kongdb.org"
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>openresty/1.7.10.1</center>
</body>
</html>

Verified the service was running:

curl -I http://127.0.0.1:4444
HTTP/1.1 200 OK
Content-Type: text/html
Date: Sun, 26 Apr 2015 00:49:36 GMT
Connection: keep-alive
@rosscdh
Copy link

rosscdh commented Apr 29, 2015

+1 had the same issue with localhost and adding 127.0.0.1 service_name.local to /etc/hosts does not seem to like hosts resolution. (osx)

@subnetmarco
Copy link
Member

This issue has been fixed and will be available in the next release of Kong.

@mogui
Copy link

mogui commented Oct 30, 2015

Which release? cause for me it's still not working this way, did we have to configure something in the docker image to let it proxy correctly?

@subnetmarco
Copy link
Member

This should have been fixed a long time ago. Does the issue happen with the current latest version 0.5.2?

On Oct 30, 2015, at 9:57 AM, mogui notifications@github.com wrote:

Which release? cause for me it's still not working this way, did we have to configure something in the docker image to let it proxy correctly?


Reply to this email directly or view it on GitHub.

@sonicaghi sonicaghi reopened this Oct 30, 2015
@subnetmarco
Copy link
Member

@mogui if you are using localhost, it will be local to the Docker container, so Kong expects the Docker container to also have an API running (which is not the case by default).

Is your API running inside the Kong Docker container, or is it running in another container?

@mogui
Copy link

mogui commented Oct 30, 2015

yes it is running outside the container, the problem is within the docker container, I have to link it outside, anyway I've solved in another way !
Thanks anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants