Welcome! Log In Create A New Profile

Advanced

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

Francis Daly
October 08, 2010 12:00PM
On Fri, Oct 08, 2010 at 04:02:48PM +0100, Frank Church wrote:

Hi there,

> With Apache when spidersample.cgi/hello is called, spidersample.cgi gets
> executed, and passes control to the hello subroutine it contains.

That'll be due to the way Apache is configured.

> With nginx instead of executing spidersample.cgi

nginx doesn't execute cgi programs. It usually is configured either to
proxy_pass the request to a http server that will, or to fastcgi_pass
with params to a fastcgi-processing server.

It might just be a terminology difference, or it might be important to
your image of what happens.

> 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.

That's probably down to the (default) configuration.

> location ~ \.cgi$ {

That says "for any request that ends in the four characters '.cgi',
use this config".

Your request for "/spidersample.cgi/hello" doesn't match, and so doesn't
use this config.

For initial testing, if you remove the "$", then the config will be
used for any request that includes the 4-char string ".cgi". That should
allow you to confirm the rest of the configuration.

Then you can change the location definition to include all and only the
requests you want handled this way.

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
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: 210
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