[Instantrails-users] Fwd: [Rails-commit] [3237] trunk/actionpack: More robust relative url root discovery for SCGI compatibility.

David Morton mortonda at dgrmm.net
Thu Dec 8 09:26:05 EST 2005

Hash: SHA1

Curt Hibbs wrote:
> Take a look at this change just committed to the Rails CVS repo...
> should help us a lot!
> More robust relative url root discovery for SCGI compatibility.  This solves the 'SCGI routes problem' -- you no longer need to prefix all your routes with the name of the SCGI mountpoint.  References #3070.
>      # Returns the path minus the web server relative installation directory.
>      # This method returns nil unless the web server is apache.
>      def relative_url_root
> -      @@relative_url_root ||= server_software == 'apache' ? File.dirname(env["SCRIPT_NAME"].to_s).gsub(/(^\.$|^\/$)/, '') : ''
> +      @@relative_url_root ||= server_software == 'apache' ? env["SCRIPT_NAME"].to_s.sub(/\/dispatch\.(fcgi|rb|cgi)$/, '') : ''

Hmm.  Well, they are a funny lot.  Sometimes I'll see a problem, try to tell
them, and they shout me down, only to actually fix the problem a month later. LOL

I'm not sure this totally solves the problem, though... when we use scgi,
there's no /dispatch\.(fcgi|rb|cgi) to match against anyway.  I haven't tested
it, but I don't see how it helps, unless one can SCGIMount /dispatch.cgi ?

- --
David Morton
Maia Mailguard                        - http://www.maiamailguard.com
Morton Software Design and Consulting - http://www.dgrmm.net
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


More information about the Instantrails-users mailing list