nginx serving R scripts via CGI/FastRWeb

Stefan Parvu sparvu at systemdatarecorder.org
Wed Feb 20 20:28:27 UTC 2013


> 
> "~" means "regex".
> "^" means "start of string".
> "$" means "end of string".
> This location will only match requests that are
>   /cgi-bin/R
> or
> 
>   /cgi-bin/R?something
> and not
> 
>   /cgi-bin/R/something
>

yep. silly me, I do have a location for all /cgi-bin/R/ calls, like:

        location ~ ^/cgi-bin/R/ {
            gzip off;
            fastcgi_pass  unix:/opt/sdr/report/ws/fastcgi_temp/nginx-fcgi.sock;
            fastcgi_index index.cgi;
            fastcgi_param SCRIPT_FILENAME /opt/sdr/report/docroot/$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_path_info;
            fastcgi_param QUERY_STRING     $query_string;
            fastcgi_param REQUEST_METHOD   $request_method;
            fastcgi_param CONTENT_TYPE     $content_type;
            fastcgi_param CONTENT_LENGTH   $content_length;
            fastcgi_param REQUEST_URI        $request_uri;
            fastcgi_param DOCUMENT_URI       $document_uri;
            fastcgi_param DOCUMENT_ROOT  /opt/sdr/report/docroot;
        }

and another one for anything *.cgi:

        location ~ ^/cgi-bin/.*\.cgi$ {
            gzip off;
            fastcgi_pass    unix:/opt/sdr/report/ws/fastcgi_temp/nginx-fcgi.sock;
            fastcgi_read_timeout    5m;
            fastcgi_index    index.cgi;
            #fastcgi_buffers  8  4k;
            #
            #  You may copy and paste the lines under or use include directive
            #  include  /etc/nginx/nginx-fcgi.conf;
            #  In this example all is in one file
            ...
        }

since under my /cgi-bin/ I can have lots of cgi scripts and the executable R cgi script.

Testing any calls for /cgi-bin/R/foo returns:
Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable?
Cannot get script name, are DOCUMENT_ROOT and SCRIPT_NAME (or SCRIPT_FILENAME) set and is the script executable?

Im trying to see if fastcgi_split_path_info might help anything.

stefan



More information about the nginx mailing list