<br><br><div class="gmail_quote">On 8 October 2010 16:55, 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;">
On Fri, Oct 08, 2010 at 04:02:48PM +0100, Frank Church wrote:<br>
<br>
Hi there,<br>
<div class="im"><br>
> With Apache when spidersample.cgi/hello is called, spidersample.cgi gets<br>
> executed, and passes control to the hello subroutine it contains.<br>
<br>
</div>That'll be due to the way Apache is configured.<br>
<div class="im"><br>
> With nginx instead of executing spidersample.cgi<br>
<br>
</div>nginx doesn'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>
> it treats<br>
> 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>That's probably down to the (default) configuration.<br>
<br>
> location ~ \.cgi$ {<br>
<br>
That says "for any request that ends in the four characters '.cgi',<br>
use this config".<br>
<br>
Your request for "/spidersample.cgi/hello" doesn't match, and so doesn't<br>
use this config.<br>
<br>
For initial testing, if you remove the "$", then the config will be<br>
used for any request that includes the 4-char string ".cgi". That should<br>
allow you to confirm the rest of the configuration.<br>
<br></blockquote><div><br><br>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 chdir to script directory (/home/rchurch/Data/Lazarus/CgiApps/spidersample.cgi)" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /spidersample.cgi/hello HTTP/1.1", upstream: "fastcgi://unix:/tmp/rchurch_cgi.sock:", host: "localhost:8118", referrer: "<a href="http://localhost:8118/spidersample.cgi">http://localhost:8118/spidersample.cgi</a>"<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>