Choosing between ProxyPassMatch and FilesMatch has proven difficult. ProxyPassMatch is unable to respect the directoryindex within subfolders a url like "http://example.com/dir/" won't work. While FilesMatch does not work if the php file is not on the apache filesystem. My preference is the FilesMatch directive.. is there any way I can get it to work without the presence of the php files? This would save me 50mb of useless data per image.
ProxyPassMatch ^/(.*\.php)$ fcgi://${PHP_HOST}:9000/code/$1
#<FilesMatch "\.php$">
# SetHandler "proxy:fcgi://%{env:PHP_HOST}:9000"
#</FilesMatch>
#<Proxy fcgi://${PHP_HOST}:9000>
# ProxySet connectiontimeout=5 timeout=240
#</Proxy>
<Directory /code>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
DirectoryIndex index.php