Nginx Load Balancer 403 error

Posted by user64473 on Server Fault See other posts from Server Fault or by user64473
Published on 2010-12-22T18:44:05Z Indexed on 2010/12/22 18:56 UTC
Read the original article Hit count: 187

Filed under:
|

I am trying to install nginx as a load balancer with apache backends, so that when I point my sites to the nginx server it serves up the content from the apache backend. I have the apache configuration set up correctly on both (i.e when I go to the site on the apache servers it works great) but when I use the nginx load balancer as the site I get 403 error. I have no idea why as it isn't even accessing any files on the server, thusly there aren't any files to be forbidden access to. My virtual host is enabled and looks like this:

upstream webs {
 server 10.0.0.30 weight=1;
 server 10.0.0.31 weight=1;
}
server {
listen   80;
server_name  www.example.com example.com;

access_log  /var/log/nginx/access.log;

location / {
        proxy_pass      http://webs;
        include         /etc/nginx/proxy.conf;

    }
}

and my nginx.conf looks like this: user www-data; worker_processes 4;

error_log  /var/log/nginx/error.log;
pid        /var/run/nginx.pid;

events {
worker_connections  1024;
# multi_accept on;
}
http {
include       /etc/nginx/mime.types;

access_log  /var/log/nginx/access.log;

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;
tcp_nodelay        on;

gzip  on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;


proxy_redirect          off;
proxy_set_header        Host            $host;
proxy_set_header        X-Real-IP       $remote_addr;
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size    10m;
client_body_buffer_size 128k;
proxy_connect_timeout   90;
proxy_send_timeout      90;
proxy_read_timeout      90;
proxy_buffers           32 4k;

}

Can any geniuses out there tell me what I am doing wrong?

© Server Fault or respective owner

Related posts about apache2

Related posts about nginx