<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#3333FF" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 22/05/2014 22:52, Valentin V.
Bartenev wrote:<br>
</div>
<blockquote cite="mid:1644079.UIZ2Qxqo28@vbart-laptop" type="cite">
<pre wrap="">On Thursday 22 May 2014 22:14:23 Lyle wrote:
</pre>
<blockquote type="cite">
<pre wrap="">...
Also gives a 403. So I suspect that nginx is looking for a file called =
in a folder named api.cgi/
I'm not sure what configuration we need to do to fix this.
</pre>
</blockquote>
<pre wrap="">[..]
As I already said, nginx knows nothing about CGI. It doesn't look for any
files in your location with "fastcgi_pass". It just passes request and
all the FastCGI params that you have configured with the values that you
have set.
For example, since you have:
fastcgi_param PATH_INFO $fastcgi_path_info;
and missing the fastcgi_split_path_info directive, then probably nginx pases
empty string in PATH_INFO.
Please, check the docs to figure out how exactly the $fastcgi_path_info
variable works and what values it takes:
<a class="moz-txt-link-freetext" href="http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#var_fastcgi_path_info">http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#var_fastcgi_path_info</a>
</pre>
</blockquote>
<br>
Ah, I see. It's the FastCGI module that's reading the wrong
filename.<br>
<br>
I think I understand the process now. Nginx is passing variables to
the fastcgi module, as defined in the config. One of these being:<br>
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;<br>
$fastcgi_script_name being everything after <a class="moz-txt-link-freetext" href="http://.../">http://.../</a> by default.
So FastCGI was trying to open a file that didn't exist. The
fastcgi_split_path_info variable addresses this issue, by
overloading $fastcgi_script_name and $fastcgi_path_info with the
split from the regexp. So adding the following:<br>
<br>
fastcgi_split_path_info ^(.+\.(?:cgi|pl))(.*)$;<br>
<br>
Before the fastcgi_param instructions has fixed the issue. Hooray!<br>
<br>
<br>
Thanks for your help.<br>
<br>
<br>
Lyle<br>
</body>
</html>