nginx 负载均衡

 时间:2026-02-17 05:51:48

1、nginx配置如下:

在入口服务器192.168.1.1设置

upstream myfastcgi {  

server 192.168.1.2:9000 weight=1;  

server 192.168.1.3:9000 weight=1;  

server{

listen 80;

server_name localhost;

root /home/html;

location ~\.php{

        include fastcgi_params;

        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        fastcgi_pass myfastcgi;

}

}

2、将服务器192.168.1.2 192.168.1.3的php-fpm配置文件

/etc/php5/fpm/pool.d/www.conf 中的listen改为 192.168.1.2:9000 和 192.168.1.3:9000

  • 配置nginx负载均衡
  • Nginx 的软件负载均衡详解
  • nginx在做负载均衡时如何配置?
  • nginx反向代理设置
  • nginx如何设置多端口
  • 热门搜索
    有什么好看的书推荐 ahead是什么意思 维生素b6的作用 运动英文 jsp是什么 工作是什么 什么植物防辐射 experiment是什么意思 最近有什么电影 460分理科能上什么大学