nginx + PHP-FPM disable PHP functions only for certain virtual hosts

Solution 1:

You can make a separate pool for your host and put restricted functions in there like this (on the last line):

[example.com]
listen = 127.0.0.1:9001
listen.allowed_clients = 127.0.0.1
user = web1
group = client0
pm = dynamic
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
chdir = /
php_admin_value[open_basedir] = /var/www/www.example.com:/usr/share/php5:/tmp:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin
php_admin_value[disable_functions] = dl,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source