Welcome! Log In Create A New Profile

Advanced

Re: proxy_pass not passing to dynamic $host

Francis Daly
November 02, 2013 05:20AM
On Fri, Nov 01, 2013 at 09:45:18PM -0400, nehay2j wrote:

Hi there,

> I did a curl on the url - curl -i https://example.com/23.23.234.234

> HTTP/1.1 302 Found
> Location: https://marketplace.example.com/marketplace/marketplace/login

> 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 Host:example.com http://23.23.234.234:8080/test

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 marketplace.example.com and not to example.com.

> 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 https://example.com/23.23.234.234

> 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.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

proxy_pass not passing to dynamic $host

nehay2j October 31, 2013 07:55PM

Re: proxy_pass not passing to dynamic $host

Francis Daly October 31, 2013 08:40PM

Re: proxy_pass not passing to dynamic $host

nehay2j October 31, 2013 09:39PM

Re: proxy_pass not passing to dynamic $host

Francis Daly November 01, 2013 01:54AM

Re: proxy_pass not passing to dynamic $host

nehay2j November 01, 2013 12:29PM

Re: proxy_pass not passing to dynamic $host

Francis Daly November 01, 2013 01:58PM

Re: proxy_pass not passing to dynamic $host

nehay2j November 01, 2013 05:16PM

Re: proxy_pass not passing to dynamic $host

nehay2j November 01, 2013 09:45PM

Re: proxy_pass not passing to dynamic $host

Francis Daly November 02, 2013 05:20AM

Re: proxy_pass not passing to dynamic $host

nehay2j November 02, 2013 10:21AM

Re: proxy_pass not passing to dynamic $host

Francis Daly November 02, 2013 12:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 136
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready