Welcome! Log In Create A New Profile

Advanced

Re: Forwarding to upstream server at port specified in url query paramter

March 06, 2013 02:04AM
Thanks for the advice on $arg_PARAMETER. It allows me to retrieve the parameter. However I am not able to use it as a port number for proxy_pass.

This shows that I can get the parameter and use it in rewrite:
location /test {
rewrite ^ http://www.google.com/?q=$arg_p;
}

This does not work. Got error "no resolver defined to resolve www.google.com" in log.
location /path {
proxy_pass http://www.google.com/?q=$arg_p;
}

This shows that I can use the parameter in a rewrite prior to proxy_pass:
location /path {
rewrite ^(.*)$ /?q=$arg_p break;
proxy_pass http://www.google.com/;
}

Unfortunately I still can't use the paramrter value as an upstream port number:
location /path2 {
rewrite ^(.*)$ :$arg_p break;
proxy_pass http://www.google.com;
}
SubjectAuthorPosted

Forwarding to upstream server at port specified in url query paramter

dakunMarch 05, 2013 07:51PM

Re: Forwarding to upstream server at port specified in url query paramter

Jonathan MatthewsMarch 05, 2013 08:20PM

Re: Forwarding to upstream server at port specified in url query paramter

dakunMarch 06, 2013 02:04AM

Re: Forwarding to upstream server at port specified in url query paramter

Jonathan MatthewsMarch 06, 2013 04:56AM

Re: Forwarding to upstream server at port specified in url query paramter

dakunMarch 06, 2013 01:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 117
Record Number of Users: 5 on December 17, 2014
Record Number of Guests: 180 on December 21, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready