There's a way to per-process override name resolution process-local override of name resolution? using HOSTALIASES. Do you think it's applicable to PHP-FPM workers too? I have this line in /etc/php-fpm.d/www.conf:
env[HOSTALIASES] = /etc/hosts.php-fpm
And when I examine $_SERVER, I see HOSTALIASES, but the actual override in the hosts.php-fpm (127.0.0.1 example.com) is not effective, it's returned from the nameservers. Do you have a suggestion on how to make (a similar solution) work?