proxy_pass not passing to dynamic $host

Francis Daly francis at
Sat Nov 2 09:18:37 UTC 2013

On Fri, Nov 01, 2013 at 09:45:18PM -0400, nehay2j wrote:

Hi there,

> I did a curl on the url - curl -i

> HTTP/1.1 302 Found
> Location:

> Which is correct.

I confess that I don't see how the configuration you show below can lead
to that response. But I don't know what upstream is doing, so maybe it
all just works.

Do you get the same response from upstream if you avoid nginx?

  curl -i -H

Also, are you aware that a HTTP 302 will cause the browser url to
change? Once the browser gets the above response, the next request goes
to and not to

> But when I submit post request through browser, I gives me
> a 404 with no error in logs.

If there's nothing in the logs, that suggests that you weren't talking
to nginx. Or that your nginx logging level is too low for what you are
trying to see.

What happens when you submit a post using curl, so you can see exactly
what happens without the browser getting in the way?

  curl -i -d key=value

> Should i be using rewrite command here or not?

I would have thought "not", but I don't know what that rewrite directive
is intended to do in the first place.

> If I remove rewrite command, it give file not found error as it picks
> default root path always.

Here, you haven't said what request you made or what result you expected.

Francis Daly        francis at

More information about the nginx mailing list