GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Plack::Middleware::LighttpdScriptNameFix(3) User Contributed Perl Documentation Plack::Middleware::LighttpdScriptNameFix(3)

Plack::Middleware::LighttpdScriptNameFix - fixes wrong SCRIPT_NAME and PATH_INFO that lighttpd sets

  # 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

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.

script_name
Even with "fix-root-scriptname", lighttpd still sets weird "SCRIPT_NAME" and "PATH_INFO" if you mount your application at "" or something that ends with "/". Setting "script_name" option tells the middleware how to reconstruct the new correct "SCRIPT_NAME" and "PATH_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=1" comes, "SCRIPT_NAME" becomes "/something" and "PATH_INFO" becomes "/a/b".

"script_name" option is set to empty by default, which means all the request path is set to "PATH_INFO" and it behaves like your fastcgi application is mounted in the root path.

Yury Zavarin

Tatsuhiko Miyagawa

Plack::Handler::FCGI <http://github.com/plack/Plack/issues#issue/68> <https://redmine.lighttpd.net/issues/729>
2020-11-30 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.