I have an apache server setup to run php for some websites, and perl cgi scripts for others. However, the perl scripts are performing poorly during search engine indexing and causing issues.
I'm trying to migrate a perl CGI to fast cgi.
here's the cgi configuration for the site:
ScriptAlias /bar "/home/foo/bar/index.cgi" Here's what I'm trying to do with fast cgi. This is using spawn_fcgi to run the app.
SetEnvIf Request_URI "^/bar(.*)" PATH_INFO=$1 ProxyPassMatch ^/bar(/|$)(.*) fcgi://127.0.0.1:9001/home/foo/bar/index.cgi/$2 ProxyPassReverse /bar(/|$)(.*) fcgi://127.0.0.1:9001/home/foo/bar/index.cgi The problem is that path_info and script_name() on CGI::Fast are giving me some weird responses. I see duplicated components or the rest of the path in CGI:Fast mode but it works fine in CGI mode with the script alias.
I suspect the proxy pass directive is wrong here. Without the SetEnvIf line, path_info is blank.
I was passing the script_name to HTML::Template and that's generating invalid links in fcgi mode but fine with CGI. The path_info is also not matching sometimes for the routing. so at /bar, I have several other endpoints that render different pages within the same script i.e. /bar/view1 /bar/view2 and so on.