Treat .htm files as PHP?

John Moore grails at
Thu Jul 2 14:05:48 MSD 2009

Phillip Oldham wrote:
> John Moore wrote:
>> Michael Shadle wrote:
>>> Should be as simple as changing a php block and changing the 
>>> extension to htm and passing it on to fastcgi like normal. I think.
>> Hmm, I'm not sure I quite understand what you mean here. Could you 
>> perhaps give me an example? When I did what I think you meant, I got 
>> an error page saying 'No input file specified'.
>> Thx.
> Follow this: - and just change 
> the location block so it checks for .html instead of .php.
> More details can be found here:
Thanks. My problem was that while PHP was working generally, I couldn't 
get it to work for the specific domain. I realized that I was 
misinforming FastCGI about the location, with this line:

fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name;

Changing it to this solved my problem:

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

Thanks for the help.

More information about the nginx mailing list