Welcome! Log In Create A New Profile

Advanced

How to process only first path element in the URL as the CGI executable

Frank Church
October 08, 2010 11:06AM
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$
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
}
}

==================================================================






--
Frank Church

=======================
http://devblog.brahmancreations.com
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to process only first path element in the URL as the CGI executable

Frank Church October 08, 2010 11:06AM

Re: How to process only first path element in the URL as the CGI executable

Francis Daly October 08, 2010 12:00PM

Re: How to process only first path element in the URL as the CGI executable

Frank Church October 08, 2010 04:16PM

Re: How to process only first path element in the URL as the CGI executable

Francis Daly October 09, 2010 06:16AM

Re: How to process only first path element in the URL as the CGI executable

Frank Church October 09, 2010 03:34PM

Re: How to process only first path element in the URL as the CGI executable

Francis Daly October 11, 2010 05:32PM

Re: How to process only first path element in the URL as the CGI executable

António P. P. Almeida October 08, 2010 12:12PM

Re: How to process only first path element in the URL as the CGI executable

Frank Church October 08, 2010 04:12PM

Re: How to process only first path element in the URL as the CGI executable

António P. P. Almeida October 08, 2010 11:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 150
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready