NAME
Plack::Middleware::LighttpdScriptNameFix - fixes wrong SCRIPT_NAME and PATH_INFO that lighttpd sets
SYNOPSIS
# in your app.psgi
use Plack::Builder;
builder {
  enable "LighttpdScriptNameFix";
  $app;
};
# Or from the command line
plackup -s FCGI -e 'enable "LighttpdScriptNameFix"' /path/to/app.psgi
DESCRIPTION
This middleware fixes wrong SCRIPT_NAME and PATH_INFO set by lighttpd when you mount your app under the root path ("/"). If you use lighttpd 1.4.23 or later you can instead enable fix-root-scriptname flag inside fastcgi.server instead of using this middleware.
CONFIGURATION
- script_name
 - 
Even with
fix-root-scriptname, lighttpd still sets weirdSCRIPT_NAMEandPATH_INFOif you mount your application at""or something that ends with/. Settingscript_nameoption tells the middleware how to reconstruct the new correctSCRIPT_NAMEandPATH_INFO.If you mount the app under
/something/, you should set:enable "LighttpdScriptNameFix", script_name => "/something";and when a request for
/something/a/b?param=1comes,SCRIPT_NAMEbecomes/somethingandPATH_INFObecomes/a/b.script_nameoption is set to empty by default, which means all the request path is set toPATH_INFOand it behaves like your fastcgi application is mounted in the root path. 
AUTHORS
Yury Zavarin
Tatsuhiko Miyagawa
SEE ALSO
Plack::Handler::FCGI http://github.com/plack/Plack/issues#issue/68 https://redmine.lighttpd.net/issues/729