Problem configuring nginx

Ian Hobson ian at
Mon Jan 19 16:39:58 MSK 2009


I wish to convert a url of the form: "http://mydomain/path/file.htm" 

to  run script   /home/ian/websites/builder/parser.php?f=/path/file.htm 
with root of  /home/ian/websites/emccatering (so the script can find 

Builder is a service script that is outside the document root and usable 
by any hosted domain. It converts pages defined in markdown into proper 
web pages.

So far I have tried all sorts and failed to achieve what I want. The 
file linked to site-available contains...

server {
   listen 80;
   server_name emc.titan.hcs;                       # testing only
   root /home/ianwebsites/emccatering           # where .htm files are
   location ~ \.htm$ {                                   # source files
      rewrite ^(.*\.htm)$ /builder/parser.php?f=$1;  
      fastcgi_param SCRIPT_FILENAME 
   location ~ \.php {

This does serve .static files properly, but .htm files produce "No input 
file specified.".

There is a "fastcgi_param SCRIPT_FILENAME   
$document_root$fastcgi_script_name; " in an include file in nginx.conf. 
If this is present php files are handled properly, and show the correct 

How can I achieve what I need?



Note -
The above has been carefully typed from another machine, but typos may 
have crept in.

Setting this up with Apache involved the Alias directive and was:-

Action   application/x-httpd-builder  "/builder/parser.php?f="
Alias /builder D:/Websites/builder

<virtualHost *:80>
  ServerName emc.mars.hcs
  DocumentRoot "D:/Websites/emccatering"
  AddType  application/x-httpd-builder .htm 



More information about the nginx mailing list