Utterly wild stab in the dark, since I don't deploy using fastcgi:šWhat's in your /etc/nginx/fastcgi_params?

After googling it I found people have had problems with PATH_INFO in Nginx.

Perhaps this part of the Nginx wiki is applicable?š

http://wiki.nginx.org/HttpFcgiModule#fastcgi_split_path_info

Thanks,
meraxes
--
dave.s.doyle@gmail.com


2011/1/26 é×ÁÎ âÅÓÓÁÒÁÂÏ× <ivan@bessarabov.ru>
I'm running dancer app with plackup:

DANCER_ENVIRONMENT='development' plackup -s FCGI --port 3001 myapp.pl

I'm using nginx as a web sever. Here is part of its config:

server {
š šlisten š 3000;
š šlocation / {
š š š šfastcgi_pass š 127.0.0.1:3001;
š š š šinclude /etc/nginx/fastcgi_params;
š š}
}

With this configuration I can access the main page of my app, but only
it. In development.log I always get:

[27975] šcore @0.000759> request: GET / from 1.1.1.1 in
/usr/share/perl5/Dancer/Handler.pm l. 49

To find out why this is so I've added 3 lines to before sub in my app:

š š š šdebug request->{path};
š š š šdebug request->path_info();
š š š šdebug request->to_string();

After restarting plackup, I access "/":

[28457] šcore @0.000769> request: GET / from 1.1.1.1 in
/usr/share/perl5/Dancer/Handler.pm l. 49
...
[28457] debug @0.035033> [hit #1]/ in /var/www/myapp/lib/myapp.pm l. 41
[28457] debug @0.035033> [hit #1]/ in /var/www/myapp/lib/myapp.pm l. 42
[28457] debug @0.038886> [hit #1][#1] GET / in /var/www/myapp/lib/myapp.pm l. 43

And here is the log when I try to access "/abc" (in the browser I
still see the main page):

[28457] šcore @0.000246> request: GET / from 1.1.1.1 in
/usr/share/perl5/Dancer/Handler.pm l. 49
...
[28457] debug @0.016833> [hit #2]/abc in /var/www/myapp/lib/myapp.pm l. 41
[28457] debug @0.018028> [hit #2]/ in /var/www/myapp/lib/myapp.pm l. 42
[28457] debug @0.018363> [hit #2][#2] GET /abc in
/var/www/myapp/lib/myapp.pm l. 43


I looked through the dancer code and found out that is be because
$self->{env}->{'PATH_INFO'} is empty line in sub _build_path_info in
the file Request.pm

A dirty workaroud is to place "request->path_info(request->{path});"
in before sub in the app. But this is bad because redirects do not
work.

So. My question is: how can I fix populating PATH_INFO in my app,
running with plackup and nginx.
_______________________________________________
Dancer-users mailing list
Dancer-users@perldancer.org
http://www.backup-manager.org/cgi-bin/listinfo/dancer-users