[cgiapp] nginx fastcgi configuration problem for C::A app

James.Q.L shijialeee at yahoo.com
Fri Aug 3 03:17:14 EDT 2012


thanks. I did try passing along PATH_INFO with that but it doesn't work, as in PERL5LIB etc all passed to my C::A app but just not PATH_INFO. even tried to set it as a string and still no dice..

my temporary workaround is to manually set path_info with request_uri value in my C::A app..


James.

P.S sorry for the top posting. yahoo mail just reminds me how crap the new interface is..



----- Original Message -----
From: hx <silent2600 at gmail.com>
To: CGI Application <cgiapp at lists.openlib.org>
Cc: 
Sent: Friday, August 3, 2012 6:34 AM
Subject: Re: [cgiapp] nginx fastcgi configuration problem for C::A app

2012/8/2 James.Q.L <shijialeee at yahoo.com>

> Hello,
>
> I am trying to get a C::A app work in nginx fastcgi environment (debian
> 6.0) and using spawn-fcgi.
>
>
> C::A route is configured using $self->mode_param( path_info=> 1, param =>
> 'rm' );
>
> the problem is that whatever C::A app urls (example.com/cities,
> example.com/profile/9999 etc )  I am requesting, it always displays the
> homepage which is what the example.com/index.pl does.
>
> my nginx setup is
>
>
> server {
>         listen   80;
>         server_name example.com;
>         root /var/www/example.com/htdocs;
>         index  index.pl index.html;
>
>         location / {
>             try_files $uri $uri/ /index.pl;
>         }
>
>         location ~ .*\.pl$ {
>                 include fastcgi_params;   # this is the stock
> fastcgi_params file supplied in debian 6.0
>                 fastcgi_index index.pl;
>                 fastcgi_param SCRIPT_FILENAME
> $document_root$fastcgi_script_name;
>                 fastcgi_param PERL5LIB "/var/www/example.com/lib";
>                 fastcgi_param CGIAPP_CONFIG_FILE "/var/www/
> example.com/conf/my.conf";
>                 fastcgi_pass unix:/var/run/fcgiwrap.socket;
>         }
> }
>
> I have successfully setup few php apps in similar fashion.
>
> in this case, however, I suspect that I am not passing essential
> fastcgi_param down to C::A which is required by it.
>
>
> what's your thoughts?
>
> James.
>
>
>
>


maybe you missed PATH_INFO

a old solution is like this:
        location /app {
                 fastcgi_pass unix:/tmp/fcgi.sock;

                 if ($uri ~ "/app(.+)") {
                   set $path_info $1;
                 }

                 fastcgi_param PATH_INFO         $path_info;
                 include /nginx/conf/fastcgi_params;
        }


or maybe use fastcgi_split_path_info , I forget my nginx config in my
virtaul machine.


More information about the cgiapp mailing list