DGRMM.net

David and Becky's little domain

SCGI and Apache 2

Posted by David Morton Thu, 08 Dec 2005 06:42:51 GMT

After that long artical about SCGI and Rails caching, I tried reinstalling, and I couldn’t reproduce the problem. Turns out, it’s a bug in the Apache 2 module. The difference?

Apache 1 sends a header like this:


add_header(t, "REQUEST_URI", original_uri(r));
Apache 2 sends this:

add_header(t, "REQUEST_URI", r->unparsed_uri);

There’s a subtle difference there. The original_uri function looks at the original HTTP request line and parses out the original request; hence it lacks the /scgi-bin/ tacked on by the rewrite rule. This is good!

On the other hand, the Apache 2 module uses the unparsed_uri field of the request, which is modified by the mod_rewrite module to include the /scgi-bin/ prefix. Not what our rails app wants!

This makes for inconsistant behaviour… The apache 2 module needs to be updated to send the original_url through to the scgi server.

no comments |