Lighttpd sets the wrong SCRIPT_NAME and PATH_INFO if you mount your FastCGI app at “/”. This middleware fixes this issue.
# File lib/rack/contrib/lighttpd_script_name_fix.rb, line 10 def call(env) env["PATH_INFO"] = env["SCRIPT_NAME"].to_s + env["PATH_INFO"].to_s env["SCRIPT_NAME"] = "" @app.call(env) end
# File lib/rack/contrib/lighttpd_script_name_fix.rb, line 6 def initialize(app) @app = app end