Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add documentation to Plack::Handler::FCGI about lighttpd issue

  • Loading branch information...
commit 2a69b9bfd4120b5f51701c595984b0026c1acd03 1 parent 19e110b
@tadam authored
Showing with 25 additions and 0 deletions.
  1. +25 −0 lib/Plack/Handler/FCGI.pm
View
25 lib/Plack/Handler/FCGI.pm
@@ -297,6 +297,31 @@ Plack::Handler::FCGI has a workaround for lighttpd's weird
C<SCRIPT_NAME> and C<PATH_INFO> setting when you set I<check-local> to
C<disable> so both configurations (root or non-root) should work fine.
+Another known issue is that lighttpd sets wrong C<SCRIPT_NAME> and C<PATH_INFO>
+if you mount your FastCGI application at any url ending with "/". This can be
+fixed by using this middleware:
+
+ package Plack::Middleware::LighttpdScriptNameFix;
+ use parent qw/Plack::Middleware/;
+
+ sub call {
+ my $self = shift;
+ my $env = shift;
+
+ $env->{PATH_INFO} = $env->{SCRIPT_NAME} . $env->{PATH_INFO};
+ $env->{SCRIPT_NAME} = '';
+
+ return $self->app->($env);
+ }
+
+ 1;
+
+Of course, use this only when your application mounted at url ending with "/".
+
+Since lighttpd 1.4.23, you also can use the "fix-root-scriptname" flag
+in fastcgi.server when you mount your application at root (exactly at "/")
+See L<https://redmine.lighttpd.net/issues/729> for more details.
+
=cut
=head1 SEE ALSO
Please sign in to comment.
Something went wrong with that request. Please try again.