How to process only first path element in the URL as the CGI executable
Frank Church
vfclists at gmail.com
Sat Oct 9 00:09:03 MSD 2010
On 8 October 2010 16:59, António P. P. Almeida <appa at perusio.net> wrote:
> On 8 Out 2010 16h02 WEST, vfclists at gmail.com wrote:
>
> > [1 <multipart/alternative (7bit)>] [1.1 <text/plain; ISO-8859-1
> > (7bit)>] I am using a FreePascal web module designed for apache
> > cgi-bin with nginx.
> >
> > The CGI itself is called spidersample.cgi and contains modules such
> > as hello, bye etc.
> >
> > With Apache when spidersample.cgi/hello is called, spidersample.cgi
> > gets executed, and passes control to the hello subroutine it
> > contains.
> >
> > 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.
> >
> > I suspect it is an easily fixed problem with some rewrite rules in
> > the configuration file and it is posted below.
> >
> > =============================================
> >
> > server {
> > listen 8118;
> > server_name localhost;
> > access_log /var/log/nginx/sysman_access.log;
> > index index.html;
> > root /home/rchurch/Data/Lazarus/CgiApps;
> >
> > location ~ \.cgi$ {
> > include /etc/nginx/fastcgi_params;
> > fastcgi_pass unix:/tmp/sysman_cgi.sock;
> > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_n$
>
> Try: fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
>
>
That is due to a cut and paste issue from a narrow terminal screen, the real
line is just as yours.
> --- appa
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>
--
Frank Church
=======================
http://devblog.brahmancreations.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20101008/780509f6/attachment-0001.html>
More information about the nginx
mailing list