I'm trying to serve a php file outside my document root with apache 2.4 and php5-fpm. My virtual host looks like this:
<VirtualHost *:8080>
ServerName www.domain.tld
DocumentRoot /data/projects/domain/www
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/data/projects/domain/www/$1
DirectoryIndex _start.php
</VirtualHost>
This website uses a webapp which is installed in /opt/vendor/webapp/. I already have an Alias to serve the static files of the webapp, this works perfectly.
But the css less and minified javascript files are generated on the fly by a php file. This doesn't seem to work because the php file is outside my DocumentRoot.
Is there a way to serve php files outside of your DocumentRoot with php-fpm?
Edit: The requests to the css and javascript files that are generated on the fly are rewritten to a php file called _generator.php. The error in de apache error log is:
[proxy_fcgi:error] [pid 22105:tid 140602507183872] [client xxx.xxx.xxx.xxx:47544] AH01071: Got error 'Primary script unknown\n'