I tried your suggestion and it worked.<br><br>I have yet to learn more about "changing the location definition to include all and only the<br> requests you want handled this way."<br><br>Thanks<br>
<br><div class="gmail_quote">On 9 October 2010 11:12, Francis Daly <span dir="ltr"><<a href="mailto:francis@daoine.org">francis@daoine.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Fri, Oct 08, 2010 at 09:10:27PM +0100, Frank Church wrote:<br>
> On 8 October 2010 16:55, Francis Daly <<a href="mailto:francis@daoine.org">francis@daoine.org</a>> wrote:<br>
> > On Fri, Oct 08, 2010 at 04:02:48PM +0100, Frank Church wrote:<br>
<br>
Hi there,<br>
<br>
</div>> > > With nginx instead of executing spidersample.cgi it treats<br>
<div class="im">> > > spidersample.cgi/hello as meaning a hello file in a spidersample.cgi<br>
> > > directory, and returns with a 404 error as there is no such directory.<br>
<br>
</div>> > > location ~ \.cgi$ {<br>
<div class="im"><br>
> > Your request for "/spidersample.cgi/hello" doesn't match, and so doesn't<br>
> > use this config.<br>
<br>
</div><div class="im">> I removed the "$" and now this is the error message I get:<br>
><br>
> 2010/10/08 21:06:46 [error] 14628#0: *22 FastCGI sent in stderr: "Cannot<br>
> chdir to script directory<br>
> (/home/rchurch/Data/Lazarus/CgiApps/spidersample.cgi)" while reading<br>
> response header from upstream, client: 127.0.0.1, server: localhost,<br>
> request: "GET /spidersample.cgi/hello HTTP/1.1", upstream:<br>
> "fastcgi://unix:/tmp/rchurch_cgi.sock:", host: "localhost:8118", referrer: "<br>
> <a href="http://localhost:8118/spidersample.cgi" target="_blank">http://localhost:8118/spidersample.cgi</a>"<br>
<br>
</div>That suggests that this location block is now being used<br>
for this request, which is good. The error is because the<br>
fastcgi processor was told that the SCRIPT_FILENAME was<br>
/home/rchurch/Data/Lazarus/CgiApps/spidersample.cgi/hello,<br>
which is untrue. SCRIPT_FILENAME is<br>
"/home/rchurch/Data/Lazarus/CgiApps/spidersample.cgi".<br>
<br>
Also, the script itself almost certainly uses PATH_INFO to determine<br>
which module of its own to use -- "hello", "echo", or some other --<br>
so you'll want to set that too.<br>
<br>
The easiest way to do both is probably to use fastcgi_split_path_info. See<br>
the two new lines below that include the string "path_info".<br>
<br>
Note -- it is possible that all of the fastcgi_param lines are unnecessary<br>
if they are already in the included /etc/nginx/fastcgi_params. You can<br>
experiment with removing them at leisure.<br>
<br>
<br>
location ~ \.cgi {<br>
fastcgi_split_path_info (.*\.cgi)(/.*);<br>
<div class="im"> include /etc/nginx/fastcgi_params;<br>
fastcgi_pass unix:/tmp/sysman_cgi.sock;<br>
</div> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;<br>
<div class="im"> fastcgi_param QUERY_STRING $query_string;<br>
fastcgi_param REQUEST_METHOD $request_method;<br>
fastcgi_param CONTENT_TYPE $content_type;<br>
fastcgi_param CONTENT_LENGTH $content_length;<br>
</div> fastcgi_param PATH_INFO $fastcgi_path_info;<br>
<div class="im"> }<br>
<br>
<br>
> > Then you can change the location definition to include all and only the<br>
> > requests you want handled this way.<br>
<br>
</div>That bit should still be done.<br>
<br>
All the best,<br>
<div><div></div><div class="h5"><br>
f<br>
--<br>
Francis Daly <a href="mailto:francis@daoine.org">francis@daoine.org</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Frank Church<br><br>=======================<br><a href="http://devblog.brahmancreations.com">http://devblog.brahmancreations.com</a><br>