Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

Dropbox as upsream server

$
0
0
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;
}

server {
listen 80;
server_name my.domain.net www.my.domain.net;
root /path/to/my/root/;

location /u/#########/ {
autoindex on;
autoindex_exact_size off;
}

location ~* ^.+.(bz2|bsp|nav)$ {
proxy_pass http://backend;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
}

}

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>