Welcome! Log In Create A New Profile

Advanced

Re: Recursive Error Pages or how to try more than one location

Elena Zwetkow
June 22, 2010 03:34AM
Oh, yes that make sense... "intercept" :) But i will try
to use proxy_next_upstream.

Thanks a lot for your fast, very fast helpful answer.

nginx, you make my day :))


-------- Original-Nachricht --------
> Datum: Tue, 22 Jun 2010 11:05:36 +0400
> Von: Igor Sysoev <igor@sysoev.ru>
> An: nginx@nginx.org
> Betreff: Re: Recursive Error Pages or how to try more than one location

> On Tue, Jun 22, 2010 at 11:02:51AM +0400, Igor Sysoev wrote:
>
> > On Tue, Jun 22, 2010 at 08:57:15AM +0200, Elena Zwetkow wrote:
> >
> > >
> > > Hello list,
> > >
> > > i have to store images on 3 servers. Image processing runs on all of
> the 3 servers and spreading the images over the 3 servers is a background
> task, so it takes some time the images are available on all 3 servers.
> > >
> > > Nginx should try to fetch the image from an other server. But my
> configuration only works 1 level depth. Nginx never trys to fetch from location
> @s2 or @s3.
> > >
> > > How can i configure nginx trying to find the image on all 3 server?
> > >
> > > Any hints are welcome.
> >
> > You should add
> >
> > proxy_intercept_errors off;
> >
> > in @s2 and @s3.
>
> Sorry, you should set
> proxy_intercept_errors on;
>
> in all @s1,2,3.
>
> > However, there is a way to handle files in one location:
> >
> > proxy_next_upstream ... http_404 ...;
> >
> > > Thanks
> > >
> > >
> > > server {
> > >
> > > listen 80;
> > > root /var/www/nginx-default;
> > >
> > > recursive_error_pages on;
> > >
> > > location @s1 {
> > > internal;
> > > proxy_pass http://192.168.0.10;
> > > proxy_intercept_errors off;
> > > proxy_store on;
> > > proxy_store_access user:rw group:rw all:rw;
> > > proxy_temp_path /var/www/nginx-default/tmp;
> > > root /var/www/nginx-default;
> > > recursive_error_pages on;
> > > error_page 404 502 = @s2;
> > > }
> > >
> > > location @s2 {
> > > internal;
> > > proxy_pass http://192.168.0.20;
> > > proxy_store on;
> > > proxy_store_access user:rw group:rw all:rw;
> > > proxy_temp_path /var/www/nginx-default/tmp;
> > > root /var/www/nginx-default;
> > > recursive_error_pages on;
> > > error_page 404 502 = @s3;
> > > }
> > >
> > >
> > > location @s3 {
> > > internal;
> > > proxy_pass http://192.168.0.30;
> > > proxy_store on;
> > > proxy_store_access user:rw group:rw all:rw;
> > > proxy_temp_path /var/www/nginx-default/tmp;
> > > root /var/www/nginx-default;
> > > recursive_error_pages on;
> > > error_page 404 = /404.htm;
> > > }
> > >
> > >
> > > location ~* \.(jpg|jpeg)$ {
> > > root /var/www/nginx-default;
> > > error_page 404 = @node1;
> > > }
> > > }
> > > --
> > > GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.
> > > Bis zu 150 EUR Startguthaben inklusive!
> http://portal.gmx.net/de/go/dsl
> > >
> > > _______________________________________________
> > > nginx mailing list
> > > nginx@nginx.org
> > > http://nginx.org/mailman/listinfo/nginx
> >
> > --
> > Igor Sysoev
> > http://sysoev.ru/en/
> >
> > _______________________________________________
> > nginx mailing list
> > nginx@nginx.org
> > http://nginx.org/mailman/listinfo/nginx
>
> --
> Igor Sysoev
> http://sysoev.ru/en/
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://nginx.org/mailman/listinfo/nginx

--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

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

Recursive Error Pages or how to try more than one location

Elena Zwetkow June 22, 2010 03:02AM

Re: Recursive Error Pages or how to try more than one location

Igor Sysoev June 22, 2010 03:08AM

Re: Recursive Error Pages or how to try more than one location

Igor Sysoev June 22, 2010 03:08AM

Re: Recursive Error Pages or how to try more than one location

Elena Zwetkow June 22, 2010 03:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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