title: Nginx load balance with dedicated php-fpm server
body: <p>I got server setup with nginx+php-fpm and mysql.
  I have another server with only installed php-fpm, so wanted to use as load balance.
  But when I am using this dedacted server with php-fpm as load balancer, I got error when opening page: "Access denied."</p>
  
  <p><strong>/etc/nginx/nginx.conf</strong></p>
  
  <pre><code>user www-data;
  worker_processes  3;
  
  error_log  /var/log/nginx/error.log;
  pid        /var/run/nginx.pid;
  
  events {
      worker_connections  1024;
  }
  
  http {
      include       mime.types;
      default_type  application/octet-stream;
      server_names_hash_bucket_size 64;
      access_log  /var/log/nginx/access.log;
  
      sendfile        on;
      #tcp_nopush      on;
  
      keepalive_timeout   65;
      tcp_nodelay         on;
  
      #gzip                on;
  
      upstream php {
          server dedicatedserverip:9000;
      }
  
      include /etc/nginx/sites-enabled/*;
  }
  </code></pre>
  
  <p><strong>/etc/nginx/sites-enabled/site.org.conf</strong></p>
  
  <pre><code>server {
      listen   81;
      server_name site.org www.site.org;
      access_log  /var/log/nginx/site.org.log;
      error_log   /var/log/nginx/site.org.log;
      root        /home/www/site.org;
      index       index.php; 
  
      location ~ .php$ {
          fastcgi_pass  php;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME /home/www/$fastcgi_script_name;
      }
  } 
  </code></pre>
  
  <p>Why I got this error? When I change only the fastcgi_pass to 127.0.0.1:9000 - all work fine.</p>