ForceType directive in nginx fastcgi?

Paul plin at
Thu Feb 22 19:22:25 MSK 2007

I'm wondering how to make certain files with no file extensions execute as PHP

In Apache, this is what I use:

<Location /search>
ForceType application/x-httpd-php

In Lighttpd, this is what I use: = ( "/search" => ".php" )
fastcgi.server             = ( ".php" =>
                               ( "localhost" =>
                                   "socket" => "/tmp/php-fastcgi.socket",

I'm trying not to use rewrites because URLs like http://host/search/a&b becomes
http://host/search.php?a&b with:

location ~ ^/search {
           root /root/path;
           rewrite ^/search?(.*)$  /search.php?$1 break;

location /search/ {
           fastcgi_param  SCRIPT_FILENAME /root/path/search.php;
           include        fastcgi_params;

drops the input parameter. I'm thinking I need to alter
fastcgi_param  QUERY_STRING       $query_string;

More information about the nginx mailing list