Welcome! Log In Create A New Profile

Advanced

Re: proxy_pass not passing to dynamic $host

November 01, 2013 05:16PM
Thanks Francis. I could finally see the post parameters at server end.
Setting proxy_set_header Host $1; changes the browser url which we donot want. Currently, the code looks like-

location ~ /(?<ec2instance>[0-9].*) {
rewrite $(.*)$ https://$http_host/test last;
proxy_pass http://$ec2instance:8080/test;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

If i set 'proxy_set_header Host $http_host;' to have $proxy_host instead of $http_host, all other things work fine other than cookies. Cookies does not get transferred. Having $http_host throws 404 error with the following entry in log-

2013/11/01 21:05:37 [error] 17515#0: *1 open() "/opt/nginx/html/test" failed (2: No such file or directory), client:
10.10.4.167, server: example.com, request: "GET /testHTTP/1.1", host: "example.com
", referrer: "http://example.com/test/test.html"

I will try to get the tcpdump of traffic.


Regards,
Neha
SubjectAuthorPosted

proxy_pass not passing to dynamic $host

nehay2jOctober 31, 2013 07:55PM

Re: proxy_pass not passing to dynamic $host

Francis DalyOctober 31, 2013 08:40PM

Re: proxy_pass not passing to dynamic $host

nehay2jOctober 31, 2013 09:39PM

Re: proxy_pass not passing to dynamic $host

Francis DalyNovember 01, 2013 01:54AM

Re: proxy_pass not passing to dynamic $host

nehay2jNovember 01, 2013 12:29PM

Re: proxy_pass not passing to dynamic $host

Francis DalyNovember 01, 2013 01:58PM

Re: proxy_pass not passing to dynamic $host

nehay2jNovember 01, 2013 05:16PM

Re: proxy_pass not passing to dynamic $host

nehay2jNovember 01, 2013 09:45PM

Re: proxy_pass not passing to dynamic $host

Francis DalyNovember 02, 2013 05:20AM

Re: proxy_pass not passing to dynamic $host

nehay2jNovember 02, 2013 10:21AM

Re: proxy_pass not passing to dynamic $host

Francis DalyNovember 02, 2013 12:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 43
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready