Welcome! Log In Create A New Profile


Load balancing & local files

September 19, 2012 09:45AM

I have 2 servers running Nginx on them while one of them also acts as a load balancer.
Each server accesses local unique image files that are generated in runtime.

I tried the following configuration for the load balancer nginx:

upstream servername {
server fail_timeout=10s;
server x.x.x.x fail_timeout=10s;


location /localimage {
proxy_pass http://servername;
root /path/to/localimage;
expires 7d;
access_log off;

Whenever the request is to server #2, I get the image, when it's to server #1 (local) I don't.
If I remove the line "proxy_pass http://servername;" the problem goes other way around.

What is the correct way to configure nginx to solve this?

Thanks in advance!
Subject Author Posted

Load balancing & local files

Fattie September 19, 2012 09:45AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 63
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready