Skip to content

Instantly share code, notes, and snippets.

@bobtfish
Created April 20, 2012 15:08
Show Gist options
  • Select an option

  • Save bobtfish/2429475 to your computer and use it in GitHub Desktop.

Select an option

Save bobtfish/2429475 to your computer and use it in GitHub Desktop.
Fix Plack::Handler::FCGI issues with nginx PATH_INFO
package Plack::Middleware::FixFCGIPath;
use strict;
use warnings;
use base qw/ Plack::Middleware /;
sub call {
my ($self, $env) = @_;
if (length($env->{PATH_INFO})) {
$env->{PATH_INFO} = '/' . $env->{PATH_INFO}
unless $env->{PATH_INFO} =~ m{^/};
}
return $self->app->($env);
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment