I'm looking for a solution to dispatch requests with nginx to optimize network connection bandwith of main server (then it should dispatch download requests to some other servers).
Here is an extract of nginx sample to perform load balacing:
upstream mystream {
server ip1:port1;
server ip2:port2;
}
server {
listen myport;
location / {
proxy_pass http://mystream;
}
}
The problem in this sample is that main server looks acting as a proxy of background servers and then not redirecting client. (it is providing file itself and then not saving bandwith).
Is there a way to configure nginx to dispatch download requests to background servers without acting as a proxy. (keep URL might be nice, but I'm open to rewrite it if needed).
Thanks