Skip to content

Instantly share code, notes, and snippets.

@miyagawa
Created September 15, 2009 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miyagawa/187070 to your computer and use it in GitHub Desktop.
Save miyagawa/187070 to your computer and use it in GitHub Desktop.
== Ideally ==
This is how PSGI spec wants web servers to define SCRIPT_NAME and PATH_INFO vars, at least I can tell from Rack and WSGI docs.
If the app is hosted on /:
URL SCRIPT_NAME PATH_INFO
----------------------------------------
/ (empty) /
/foo (empty) /foo
/foo/bar (empty) /foo/bar
If the app is hosted on /foo:
URL SCRIPT_NAME PATH_INFO
----------------------------------------
/foo /foo (empty)
/foo/ /foo /
/foo/bar /foo /bar
== Apache (mod_cgi) ==
If the app is hosted on /foo: (foo is a .cgi file)
URL SCRIPT_NAME PATH_INFO
----------------------------------------
/foo /foo (empty)
/foo/ /foo /
/foo/bar /foo /bar
== Apache (mod_perl) ==
If the app is hosted on / with
<Location />
SetHandler perl-script
PerlHandler Foo
</Location>
URL SCRIPT_NAME PATH_INFO
----------------------------------------
/ / (empty)
/foo /foo (empty)
/foo/bar /foo /bar
If the app is hosted on /foo with
<Location /foo>
SetHandler perl-script
PerlHandler Foo
</Location>
URL SCRIPT_NAME PATH_INFO
----------------------------------------
/foo /foo (empty)
/foo/ /foo /
/foo/bar /foo /bar
== Lighttpd (mod_fastcgi) ==
If the app is hosted on / with
(
"" =>
((
"socket" => "/tmp/fcgi.sock",
"check-local" => "disable"
))
)
URL SCRIPT_NAME PATH_INFO
----------------------------------------
/ / (empty)
/foo /foo (empty)
/foo/bar /foo/bar (empty)
If the app is hosted on /foo with
(
"/foo" =>
((
"socket" => "/tmp/fcgi.sock",
"check-local" => "disable"
))
)
URL SCRIPT_NAME PATH_INFO
----------------------------------------
/foo /foo (empty)
/foo/ /foo /
/foo/bar /foo /bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment