I got server setup with nginx + php-fpm and mysql. I have another server with php-fpm installed, so I wanted to use it as a load balance. But when I use this dedicated server with php-fpm as load balancing, I got an error opening the page: "Access is denied."
/etc/nginx/nginx.conf
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;
/etc/nginx/sites-enabled/site.org.conf
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; } }
Why did I get this error? When I change only fastcgi_pass to 127.0.0.1:9000 - everything works fine.
source share