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 with localhost as target_url #182

Closed
montanaflynn opened this issue Apr 29, 2015 · 3 comments
Closed

502 with localhost as target_url #182

montanaflynn opened this issue Apr 29, 2015 · 3 comments
Labels

Comments

@montanaflynn
Copy link

Getting 502 from Kong when acting as a reverse proxy for a local service using localhost in the target_url. As you can see the service is up and running and works when added to Kong as 127.0.0.1 but when using localhost Kong returns a 502.

$ curl localhost:8001/apis/ | jq .
{
  "data": [
    {
      "created_at": 1430299086000,
      "name": "lwan",
      "target_url": "http://localhost:4444",
      "id": "2d27547e-5bd1-466c-c632-6ce4e68cb255",
      "public_dns": "lwan.com"
    },
    {
      "created_at": 1430299175000,
      "name": "lwan2",
      "target_url": "http://127.0.0.1:4444",
      "id": "1e07b7c5-d0c7-4354-c3b9-4083c59d8fd3",
      "public_dns": "lwan2.com"
    }
  ]
}

$ curl http://localhost:4444/hello
Hello, world!

$ curl http://localhost:8000/hello -H "host:lwan.com"
<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>openresty/1.7.10.2rc0</center>
</body>
</html>

$ curl http://localhost:8000/hello -H "host:lwan2.com"
Hello, world!
@subnetmarco
Copy link
Member

The same problem might be related to #163 and may be caused by #127 - will look into it.

@montanaflynn
Copy link
Author

I don't think it's related to #163 as that issue is using 127.0.0.1 and as far as I know only affects Kong running in docker. It may be related to #127, in fact there's another issue brought up in gitter chat that could also be related so I'll make an issue for that as well.

@subnetmarco
Copy link
Member

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

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

2 participants