[Dancer-users] path_info is not set up

Dave Doyle dave.s.doyle at gmail.com
Wed Jan 26 07:49:45 CET 2011


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 at gmail.com


2011/1/26 Иван Бессарабов <ivan at 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.pml. 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 at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20110126/1e1c45d3/attachment-0001.htm>


More information about the Dancer-users mailing list