nginx serving R scripts via CGI/FastRWeb

Stefan Parvu sparvu at
Tue Feb 19 14:49:15 UTC 2013

On 08:50 Tue 19 Feb     , Harold Sinclair wrote:
> Does the R cgi script filename end in .cgi ? That's what you specify, it
> appears.

No, it does not end with cgi since the R scripts will not be called directly
by nginx.

As I understood I should call the R scripts like: http://localhost/cgi-bin/R/foo where
there is a R binary file under cgi-bin which will proxy those to FastRWeb 
and Rserve R modules. So under cgi-bin there are no R scripts whatsoever, 
but they usually will go under: /opt/sdr/report/var/FastRWeb/web.R directory.

Now my problem seems to be related how the R binary under cgi-bin will
ever be called via CGI and further FastRWeb ... since my nginx.conf knows nada
about R being called. Currently my nginx.conf is configured to run
anything ending .cgi as cgi scripts ...

$ ls -lrt
total 60
-rwxr-x--- 1 sdr sdr  3715 Feb 19 12:00 initial.cgi
-rwxr-xr-x 1 sdr sdr 55932 Feb 19 13:53 R

$ file R
R: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x0351c94aaf487ee3559a722446865b7ae0f3b7cc, not stripped

Here the R scripts:

$ ls -lrt
total 16
drwxr-xr-x 2 sdr sdr 4096 Feb 18 00:08 web
drwxr-xr-x 2 sdr sdr 4096 Feb 18 00:08 tmp
drwxr-xr-x 2 sdr sdr 4096 Feb 19 14:27 code
srw-rw-rw- 1 sdr sdr    0 Feb 19 14:27 socket
=>> drwxr-xr-x 2 sdr sdr 4096 Feb 19 14:28 web.R

all R scripts will go here web.R directory. 


More information about the nginx mailing list