<br><br><div class="gmail_quote">On 8 October 2010 16:55, Francis Daly <span dir="ltr">&lt;<a href="mailto:francis@daoine.org">francis@daoine.org</a>&gt;</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;">
On Fri, Oct 08, 2010 at 04:02:48PM +0100, Frank Church wrote:<br>
<br>
Hi there,<br>
<div class="im"><br>
&gt; With Apache when spidersample.cgi/hello is called, spidersample.cgi gets<br>
&gt; executed, and passes control to the hello subroutine it contains.<br>
<br>
</div>That&#39;ll be due to the way Apache is configured.<br>
<div class="im"><br>
&gt; With nginx instead of executing spidersample.cgi<br>
<br>
</div>nginx doesn&#39;t execute cgi programs. It usually is configured either to<br>
proxy_pass the request to a http server that will, or to fastcgi_pass<br>
with params to a fastcgi-processing server.<br>
<br>
It might just be a terminology difference, or it might be important to<br>
your image of what happens.<br>
<div class="im"><br>
&gt; it treats<br>
&gt; spidersample.cgi/hello as meaning a hello file in a spidersample.cgi<br>
&gt; directory, and returns with a 404 error as there is no such directory.<br>
<br>
</div>That&#39;s probably down to the (default) configuration.<br>
<br>
&gt;         location ~ \.cgi$ {<br>
<br>
That says &quot;for any request that ends in the four characters &#39;.cgi&#39;,<br>
use this config&quot;.<br>
<br>
Your request for &quot;/spidersample.cgi/hello&quot; doesn&#39;t match, and so doesn&#39;t<br>
use this config.<br>
<br>
For initial testing, if you remove the &quot;$&quot;, then the config will be<br>
used for any request that includes the 4-char string &quot;.cgi&quot;. That should<br>
allow you to confirm the rest of the configuration.<br>
<br></blockquote><div><br><br>I removed the &quot;$&quot; 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: &quot;Cannot chdir to script directory (/home/rchurch/Data/Lazarus/CgiApps/spidersample.cgi)&quot; while reading response header from upstream, client: 127.0.0.1, server: localhost, request: &quot;GET /spidersample.cgi/hello HTTP/1.1&quot;, upstream: &quot;fastcgi://unix:/tmp/rchurch_cgi.sock:&quot;, host: &quot;localhost:8118&quot;, referrer: &quot;<a href="http://localhost:8118/spidersample.cgi">http://localhost:8118/spidersample.cgi</a>&quot;<br>
<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Then you can change the location definition to include all and only the<br>
requests you want handled this way.<br>
<br>
Good luck with it,<br>
<br>
        f<br>
<font color="#888888">--<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>
</font></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>