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

vmc problem 0.5.0.beta.10 #5

Open
mreider opened this issue Feb 14, 2013 · 4 comments
Open

vmc problem 0.5.0.beta.10 #5

mreider opened this issue Feb 14, 2013 · 4 comments

Comments

@mreider
Copy link
Contributor

mreider commented Feb 14, 2013

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?

@andreacampi
Copy link
Owner

See this comment: cloudfoundry-attic/vmc-lib@5148d6c#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
Copy link
Owner

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 referenced this issue in cloudfoundry-attic/vmc-lib Feb 16, 2013
previously only redirected for GET/HEAD; now just convert to GET

Change-Id: I7fc81a0cb58e49acaae9fb9833b6eea4df29d72f
@andreacampi
Copy link
Owner

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 pushed a commit that referenced this issue Feb 16, 2013
@andreacampi
Copy link
Owner

Can you try again now?

One caveat with 0.5.x: vmc register does not work, see cloudfoundry-attic/vmc#59

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

No branches or pull requests

2 participants