Welcome! Log In Create A New Profile

Advanced

Re: nginx serving R scripts via CGI/FastRWeb

Francis Daly
February 19, 2013 12:26PM
On Tue, Feb 19, 2013 at 12:47:23PM +0000, Stefan Parvu wrote:

Hi there,

This location:

> location ~ ^/cgi-bin/.*\.cgi$ {

will only match some requests that end in ".cgi" (before the ?, if
that applies).

What you possibly want is a separate location just for your "R" requests.

Something like (untested by me!)

location ^~ /cgi-bin/R/ { }

in which you have your "fastcgi_pass" directive, plus whatever
"fastcgi_param" directives you need to make it work. That is *probably*

fastcgi_param REQUEST_URI $request_uri;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param SCRIPT_FILENAME $document_root/cgi-bin/R;

but the exact details depend on what your fastcgi server wants.

(You may want to set PATH_INFO, if your application uses that.)

See http://nginx.org/r/location for the details of which one location{}
is chosen for each request, and then see the fastcgi documentation to
decide exactly what params you need.

Usually, SCRIPT_FILENAME is "the file on the filesystem that the fastcgi
server should execute"; and other things are "stuff that the fastcgi
server or the application can use to decide what to do".

> and Im using fcgiwrap from http://nginx.localdomain.pl/wiki/FcgiWrap.
> CGI scripts work fine but Im not able to any R scripts probable due
> R being not correctly called via nginx.conf ...

In this case, yes. Your nginx configuration was such that your requests
for "R" were not being sent to the fastcgi server.

> I am trying something like: http://localhost/cgi-bin/R/foo.png?n=500
> and R is a binary file under cgi-bin directory which should call
> FastRWeb ...

Provided that the fastcgi server is able to run whatever file you name in
SCRIPT_FILENAME, and has access to whatever other params it cares about,
something like the above configuration has a chance of working.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx serving R scripts via CGI/FastRWeb

Stefan Parvu February 19, 2013 07:50AM

Re: nginx serving R scripts via CGI/FastRWeb

Harold Sinclair February 19, 2013 08:52AM

Re: nginx serving R scripts via CGI/FastRWeb

Stefan Parvu February 19, 2013 09:52AM

Re: nginx serving R scripts via CGI/FastRWeb

Harold Sinclair February 19, 2013 11:24AM

Re: nginx serving R scripts via CGI/FastRWeb

Stefan Parvu February 19, 2013 11:42AM

Re: nginx serving R scripts via CGI/FastRWeb

Stefan Parvu February 19, 2013 11:44AM

Re: nginx serving R scripts via CGI/FastRWeb

Francis Daly February 19, 2013 12:26PM

Re: nginx serving R scripts via CGI/FastRWeb

Stefan Parvu February 20, 2013 05:04AM

Re: nginx serving R scripts via CGI/FastRWeb

Francis Daly February 20, 2013 08:26AM

Re: nginx serving R scripts via CGI/FastRWeb

Stefan Parvu February 20, 2013 03:32PM

Re: nginx serving R scripts via CGI/FastRWeb

Francis Daly February 20, 2013 04:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 73
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