漂亮男人2017-05-16 17:09:31
例如PHP负载均衡不需要反向代理,直接fastcgi_pass到多个php-fpm也可以做负载均衡。
具体配置:
upstream myapp {
server 192.168.20.1:9000; # PHP-FPM 1
server 192.168.20.2:9000; # PHP-FPM 2
......
}
server {
listen 80;
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /phpfiles$fastcgi_script_name;
fastcgi_pass myapp;
}
}