AddHandler application/x-httpd-php .htm in nginx?

Cliff Wells cliff at develix.com
Wed Aug 18 03:00:47 MSD 2010


On Fri, 2010-03-26 at 11:10 +0100, Luka Horvatic wrote:
> Edho P Arief wrote:
> > On Fri, Mar 26, 2010 at 6:48 AM, Luka Horvatic <lists at ruby-forum.com> 
> > wrote:
> >> That command in apache htaccess allows to read htm files as php,so then
> >> you can load php file with extension htm.How do i enable this on nginx?
> >> --
> > 
> > location ~ \.htm$ {
> >   fastcgi_pass ...
> >   ...
> > }
> > 
> > --
> > O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
> 
> Forgot to say how i tried following:
>     location ~ \.htm$ {
>             root           /location;
>             fastcgi_pass   127.0.0.1:9000;
> 
>             fastcgi_param  SCRIPT_FILENAME 
> /location$fastcgi_script_name;
>             include        fastcgi_params;
>         }
> It didn't work,it still read php file as html file.On the other hand,i 
> bet it would work if i would pick some misc extension like php2.


This *will* work.  The extension is irrelevant to Nginx.   Perhaps you
should post your entire config.   Also, be 100% certain you are not
encountering browser caching (this catches me out now and again).

Cliff

-- 




More information about the nginx mailing list