nginx load balancing

António P. P. Almeida appa at perusio.net
Sun Mar 4 15:02:55 UTC 2012


On 4 Mar 2012 06h11 CET, apostols at gmail.com wrote:

> Hi,
>
> I try configure nginx load balancing with 3 nodes but never show
> images or ccs style from nodes and always obtain this error:
>
> 2012/03/03 22:36:43 [error] 11321#0: *7 open()
> "/usr/local/nginx/html/melchor.jpg" failed (2: No such file or
> directory), client: 181.XX.XX.XX, server: edge.lb.tld, request: "GET
> /melchor.jpg HTTP/1.1", host: "edge.lb.tld", referrer:
> "http://edge.lb.tld/"
> 2012/03/03 22:38:16 [error] 11321#0: *19 open()
> "/usr/local/nginx/html/css/style.css" failed (2: No such file or
> directory), client: 200.XX.XX.XX, server: edge.lb.tld, request: "GET
> /css/style.css HTTP/1.1", host: "edge.lb.tld", referrer:
> "http://edge.lb.tld/"
>
> This is my vhost config:
>
> upstream edge {
> server 72.XX.XX.XX:80;
> server 216.XX.XX.XX:80;
> server 184.XX.XX.XX:80;
> }
>
> server {
> server_name edge.lb.tld;
>
> error_log  /var/log/nginx/EDGE.error_log warn;
>
> location / {
> proxy_set_header Host $http_host;
> proxy_pass  http://edge;
> }
> }

Perhaps the links in the site do not point to the proper
location. With a config as simple as yours, the problem is either in
the app or in the backend configuration. You have no root defined so
Nginx is trying the open the files with the default root:

/usr/local/nginx/html

I suggest you enable the debug log and trace the request:

http://nginx.org/en/docs/debugging_log.html

--- appa



More information about the nginx mailing list