1Plack::Middleware::LighUtsteprdSCcornitprtiNbaumtPeelFdaicxPk(e:3r:)lMiDdodcluemweanrtea:t:iLoinghttpdScriptNameFix(3)
2
3
4
6 Plack::Middleware::LighttpdScriptNameFix - fixes wrong SCRIPT_NAME and
7 PATH_INFO that lighttpd sets
8
10 # in your app.psgi
11 use Plack::Builder;
12
13 builder {
14 enable "LighttpdScriptNameFix";
15 $app;
16 };
17
18 # Or from the command line
19 plackup -s FCGI -e 'enable "LighttpdScriptNameFix"' /path/to/app.psgi
20
22 This middleware fixes wrong "SCRIPT_NAME" and "PATH_INFO" set by
23 lighttpd when you mount your app under the root path ("/"). If you use
24 lighttpd 1.4.23 or later you can instead enable "fix-root-scriptname"
25 flag inside "fastcgi.server" instead of using this middleware.
26
28 script_name
29 Even with "fix-root-scriptname", lighttpd still sets weird
30 "SCRIPT_NAME" and "PATH_INFO" if you mount your application at ""
31 or something that ends with "/". Setting "script_name" option tells
32 the middleware how to reconstruct the new correct "SCRIPT_NAME" and
33 "PATH_INFO".
34
35 If you mount the app under "/something/", you should set:
36
37 enable "LighttpdScriptNameFix", script_name => "/something";
38
39 and when a request for "/something/a/b?param=1" comes,
40 "SCRIPT_NAME" becomes "/something" and "PATH_INFO" becomes "/a/b".
41
42 "script_name" option is set to empty by default, which means all
43 the request path is set to "PATH_INFO" and it behaves like your
44 fastcgi application is mounted in the root path.
45
47 Yury Zavarin
48
49 Tatsuhiko Miyagawa
50
52 Plack::Handler::FCGI <http://github.com/plack/Plack/issues#issue/68>
53 <https://redmine.lighttpd.net/issues/729>
54
55
56
57perl v5.38.0 20P2l3a-c0k7:-:2M1iddleware::LighttpdScriptNameFix(3)