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
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: 169
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready