something like this? location ~ \.(php)$ { fastcgi_pass php_fpm_backend; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin/$fastcgi_script_name; ... } this catches all files with .php extension. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,188514,188556#msg-188556