apache 2.4 php-fpm proxypassmatch for pretty urls

Posted by tubaguy50035 on Server Fault See other posts from Server Fault or by tubaguy50035
Published on 2012-10-18T20:37:46Z Indexed on 2012/10/31 23:04 UTC
Read the original article Hit count: 361

Filed under:
|
|

I have a URL like http://newsymfony.dev/app_dev.php/_profiler/5080653d965eb.

I would like to send this script to PHP-FPM. I currently have this as my vhost:

VirtualHost *:80>
    ServerName newsymfony.dev
    DocumentRoot /home/COMPANY/nwalke/www/newsymfony.dev/web/
    ErrorLog /var/log/apache2/error_log
    LogLevel info
    CustomLog /var/log/apache2/access_log combined
    <Directory /home/COMPANY/nwalke/www/newsymfony.dev/web/>
        AllowOverride All
        Require all granted
        DirectoryIndex app.php
    </Directory>
    ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:9003/home/COMPANY/nwalke/www/newsymfony.dev/web/$1
</VirtualHost>

If I browse to app_dev.php it works just fine. But if I do app_dev.php/_profiler/5080653d965eb I get a 404 and the request never gets sent to FPM. How can I alter my ProxyPassMatch to pass anything with .php in the URL?

I'm trying to do this with Symfony, but I'm pretty sure it applies to everything.

© Server Fault or respective owner

Related posts about apache2

Related posts about php