The pattern does not require two machines or a load balancer — two upstreams and an nginx variable will do it, and the rollback becomes a config reload.
upstream app_blue { server unix:/run/php/blue.sock; }
upstream app_green { server unix:/run/php/green.sock; }
# /etc/nginx/conf.d/active.conf — one line, rewritten by the deploy
# set $active app_green;
location ~ .php$ {
fastcgi_pass $active;
}
Two php-fpm pools with their own sockets and their own release directories means both versions are running simultaneously, so the switch is instantaneous and the rollback is the same operation in reverse. The cost is double the memory for the pools, which on a modest application is tens of megabytes. The thing that makes it work is that the shared state — the database, the sessions, the uploads — is genuinely shared, which is the same constraint any blue-green deployment has.