Welcome! Log In Create A New Profile

Advanced

RE: Proxy Retry Logic

Sirsiwal, Umesh
December 22, 2010 09:26PM
That's the second configuration I tried:
location @sub1 {
proxy_pass http://www.1google.com;
}
location @sub2 {
proxy_pass http://www.google.com;
}
location @s {
proxy_pass http://www.yahoo.com;
}

location / {
try_files @sub1 @sub2 @s;
}


I got the following log:

> 2010/12/22 20:48:52 [debug] 1637#0: *3 try to use file: "@sub1" "/Users/umesh/nginx/install/html@sub1"
> 2010/12/22 20:48:52 [debug] 1637#0: *3 try to use file: "@sub2" "/Users/umesh/nginx/install/html@sub2"

At least according to this e-mail http://forum.nginx.org/read.php?2,28297 chain, it seems I cannot use named locations in try_files directory except as the last location.


-Umesh

________________________________________
From: Eugaia [ngx.eugaia@gmail.com]
Sent: Wednesday, December 22, 2010 9:08 PM
To: nginx-devel@nginx.org
Subject: Re: Proxy Retry Logic

Hi,

On 23/12/2010 03:51, Sirsiwal, Umesh wrote:
> Thanks Marcus.
> I really like echo module. My module's subrequest handling is modeled after the excellent echo module. We have significant custom logic to deal with our specific needs.
>
> I did not realize try_files can use with proxy locations. I did see the internal redirect in the configuration example used proxy. But, I did not realize that I could use it in other places.
>
> I tried using
> location /sub1 {
> proxy_pass http://www.1google.com;
> }
> resolver 216.195.0.131;
> location /sub2 {
> proxy_pass http://www.google.com;
> }
> location @s {
> proxy_pass http://www.yahoo.com;
> }
>
>
> location / {
> try_files /sub1/$uri /sub2/$uri @s;
> }
>
> I always get www.yahoo.com. Looking at the logs:
> 2010/12/22 20:44:55 [debug] 1607#0: *1 try to use file: "/sub1//" "/Users/umesh/nginx/install/html/sub1//"
> 2010/12/22 20:44:55 [debug] 1607#0: *1 http script copy: "/sub2/"
> 2010/12/22 20:44:55 [debug] 1607#0: *1 http script var: "/"
> 2010/12/22 20:44:55 [debug] 1607#0: *1 try to use file: "/sub2//" "/Users/umesh/nginx/install/html/sub2//"
> This was followed by testing @s which served the content.
>
> I tried replacing /sub1 and /sub2 with named location and I get:
> 2010/12/22 20:48:52 [debug] 1637#0: *3 try to use file: "@sub1" "/Users/umesh/nginx/install/html@sub1"
> 2010/12/22 20:48:52 [debug] 1637#0: *3 try to use file: "@sub2" "/Users/umesh/nginx/install/html@sub2"
> This was followed by testing @s which served the content.
You'll need to change the names of the locations from /sub1 to @sub1 as
well as the references in try_files. Note : you can't put slashes after
the @sub[n] part (unless you put them in the named location as well),
but you can obvioiusly create the URL that you proxy to in in the
proxy_pass directive inside the named location.

The /sub1 and /sub2 I was referring to was for echo_location, which can
be a named or normal location.

Cheers,

Marcus.

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel

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

Proxy Retry Logic

Sirsiwal, Umesh 2402 December 22, 2010 02:28PM

Re: Proxy Retry Logic

Maxim Dounin 910 December 22, 2010 06:40PM

RE: Proxy Retry Logic

Sirsiwal, Umesh 996 December 22, 2010 07:56PM

Re: Proxy Retry Logic

Eugaia 923 December 22, 2010 08:20PM

RE: Proxy Retry Logic

Sirsiwal, Umesh 943 December 22, 2010 08:52PM

Re: Proxy Retry Logic

Eugaia 1014 December 22, 2010 09:10PM

RE: Proxy Retry Logic

Sirsiwal, Umesh 840 December 22, 2010 09:26PM

Re: Proxy Retry Logic

Eugaia 895 December 22, 2010 09:38PM

RE: Proxy Retry Logic

Sirsiwal, Umesh 913 December 22, 2010 09:52PM

Re: Proxy Retry Logic

Eugaia 1141 December 23, 2010 04:00AM

Re: Proxy Retry Logic

Eugaia 971 December 23, 2010 04:36AM

RE: Proxy Retry Logic

Sirsiwal, Umesh 1149 December 23, 2010 08:12AM

Re: Proxy Retry Logic

Eugaia 847 December 22, 2010 09:22PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 303
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