I am using a FreePascal web module designed for apache cgi-bin with nginx.<br><br>The CGI itself is called spidersample.cgi and contains modules such as hello, bye etc.<br><br>With Apache when spidersample.cgi/hello is called, spidersample.cgi gets executed, and passes control to the hello subroutine it contains.<br>
<br>With nginx instead of executing spidersample.cgi it treats spidersample.cgi/hello as meaning a hello file in a spidersample.cgi directory, and returns with a 404 error as there is no such directory.<br><br>I suspect it is an easily fixed problem with some rewrite rules in the configuration file and it is posted below.<br>
<br>=============================================<br><br> server {<br> listen 8118;<br> server_name localhost;<br> access_log /var/log/nginx/sysman_access.log;<br> index index.html;<br> root /home/rchurch/Data/Lazarus/CgiApps;<br>
<br> location ~ \.cgi$ {<br> include /etc/nginx/fastcgi_params;<br> fastcgi_pass unix:/tmp/sysman_cgi.sock;<br> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_n$<br>
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>
}<br> }<br><br>==================================================================<br> <br><br><br><br><br clear="all"><br>-- <br>Frank Church<br><br>=======================<br><a href="http://devblog.brahmancreations.com">http://devblog.brahmancreations.com</a><br>