cloudfoundry-vagrant icon indicating copy to clipboard operation
cloudfoundry-vagrant copied to clipboard

vmc problem 0.5.0.beta.10

Open mreider opened this issue 12 years ago • 4 comments

We thought the new vmc had a bug that was preventing it from targeting the local install, but it looks like you have a redirect without a port - and old vmc isn't being redirected. New vmc is, and is getting lost in the process.

Can you test with new vmc?

mreider avatar Feb 14 '13 00:02 mreider

See this comment: https://github.com/cloudfoundry/vmc-lib/commit/5148d6c68668413303e7d8cc8c286130b9cc8db5#commitcomment-2577769

The attached log was captured a week ago with the then-latest version of vmc.

it looks like you have a redirect without a port

Agreed, but I'm not sure I can work around that. However now you've put doubt in my mind, I will have to test it again. It might well be that I need to configure external_uri in the cloud_controller to point to port 9080.

andreacampi avatar Feb 14 '13 19:02 andreacampi

More details:

AFAICT the CC (at least the legacy CC) generates redirects using standard Rails conventions; that is, using the port the request came in, as conveyed by Rack env variables.

This works nicely when the CC listens on a TCP port (e.g. 9022 as customary), as it will redirect there. It also works nicely when it is fronted by nginx as shown above, AND accessed via the router sitting on port 80: the CC won't see any port, so it will assume port 80, which just happens to be correct. But of course this assumption breaks down when the router is listening on a different port.

The CC has two configuration knobs that are vaguely related, external_uri and external_port, but neither is taken into account for redirects. In particular external_port is misleading: it is in fact the port that other components should use when talking to the CC.

andreacampi avatar Feb 16 '13 10:02 andreacampi

Adding:

    proxy_set_header            X-Forwarded-Host $host:9080;

to the nginx router config fixed the issue for me, as long as the CC is only accessed on port 9080.

That's acceptable for now, so I'll make this change in the Vagrant setup and retire the port 9022 NAT.

andreacampi avatar Feb 16 '13 11:02 andreacampi

Can you try again now?

One caveat with 0.5.x: vmc register does not work, see https://github.com/cloudfoundry/vmc/issues/59

andreacampi avatar Feb 17 '13 21:02 andreacampi