minimal fastcgi config for 1 file?

Maxim Dounin mdounin at mdounin.ru
Thu Feb 13 12:42:02 UTC 2014


Hello!

On Wed, Feb 12, 2014 at 03:26:21PM -0800, Grant wrote:

> Is it OK to use a minimal fastcgi configuration for a single file like this:
> 
> location ~ ^/piwik/piwik.php$ {

It doesn't make sense to use regular expression here.  Instead, 
use exact match location:

    location = /piwik/piwik.php {

>     fastcgi_pass unix:/run/php-fpm.socket;
>     include fastcgi_params;

The "fastcgi_params" file as shipped with nginx doesn't set the 
SCRIPT_FILENAME parameter, and php will likely unable to handle 
such a request.  Use "include fastcgi.conf;" instead if you don't 
need SCRIPT_FILENAME customization.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list