Welcome! Log In Create A New Profile

Advanced

Re: Dropbox as upsream server

Maxim Dounin
April 11, 2013 07:06AM
Hello!

On Thu, Apr 11, 2013 at 04:15:02AM -0400, winniethepooh wrote:

> I'm trying to use the Dropbox public folder and my nginx server as a
> upstream server to server static files. I'm hoping someone can point me in
> the right direction or tell me what I'm doing wrong.
>
> So:
> my.domain.net/u/#########/*.bz2 serves from
> http://dl.dropbox.com/u/#########/*.bz2 "twice" as much as
> my.domain.net/u/#########/*.bz2
>
> It seems when the server uses the x.x.x.x:80 it loops and hits the
> proxy_pass directive over and over resulting in a 500 error.
>
> Any help is appreciated!
>
>
> Here is what my configuration looks like:
> upstream backend {
> server x.x.x.x:80 weight=1 max_fails=2;
> server dl.dropbox.com:80 weight=2 max_fails=2;
> }

It's not clear why you added "x.x.x.x" to the upstream block if
it's not an upstream but the same server. Obvious solution would
be to remove it.

If you try to implement "check the local disk, and if the file
isn't there - proxy to dropbox" logic, correct solution would be
to use something similar to an example provided at
http://nginx.org/r/error_page:

location / {
error_page 404 = @fallback;
}

location @fallback {
proxy_pass http://backend;
}

--
Maxim Dounin
http://nginx.org/en/donation.html

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

Dropbox as upsream server

winniethepooh April 11, 2013 04:15AM

Re: Dropbox as upsream server

Maxim Dounin April 11, 2013 07:06AM

Re: Dropbox as upsream server

winniethepooh April 11, 2013 11:08AM

Re: Dropbox as upsream server

Maxim Dounin April 11, 2013 11:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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