nginx php mysql负载均衡_Nginx负载均衡与专用的php-fpm服务器

我用nginx php-fpm和mysql安装了服务器.

我有另一台服务器只安装了php-fpm,所以想用作负载平衡.

但是当我使用这个带有php-fpm的dedacted服务器作为负载均衡器时,我在打开页面时遇到错误:“拒绝访问”.

/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;

#tcp_nopush on;

keepalive_timeout 65;

tcp_nodelay on;

#gzip on;

upstream php {

server dedicatedserverip:9000;

}

include /etc/nginx/sites-enabled/*;

}

/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;

}

}

为什么我收到此错误?当我只将fastcgi_pass更改为127.0.0.1:9000时 – 一切正常.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值