Forum Moderators: phranque
A configuration has an Apache web server which handles everything (html, perl, php, etc.) with the single exception of Coldfusion. This is installed on a second server, running the Sun Application Server.
Using RedirectMatch, for example, it's very easy to instruct Apache to send anything that ends in .cfm to this second server. The problem is, that Coldfusion is now more than happy to display the output and start processing any link clicks that happen from this page -- essentially becoming your new web server.
This doesn't work for this setup, because everything else resides on the Apache server.
The question is: Is there a way to direct a .cfm file to the second server to be executed, but instead having the output "captured" and displayed by the Apache server...? In that way the user doesn't know a second server was involved, and most importantly, the second server never processes any links or html requests.
(For purposes of the discussion, no, it's not possible to run Apache and Coldfusion on the same server -- I know it's the more common option, but there ya go... :-)
i.e., in a directory sample/, there might be sample/index.html and sample/script.cfm.
The proxy will handle the cfm file great, but it also proxies the html file over to the secondary server, and I don't want that.
Initially, I was hoping that a regular expression could be used to cull out only the files ending in .cfm, but it doesn't seem to permit that.
(I also thought of using the rewrite rules to rewrite the URL for anything that's a .cfm -- that works great, but the proxy directive only sees the original URL, not the rewritten one, so I can't seem to "cheat" in that way either (by rewriting the path to something unique)).
What I ultimately need is something that works along the line of:
ProxyPass (.*)\.cfm$ [server...]
ProxyPassReverse (.*)\.cfm$ [server...]
ReWriteEngine on
RewriteRule (.*)\.cfm$ /cfm/$1.cfm [P]
ProxyPass /cfm [cfm.server...]
ProxyPassReverse /cfm [cfm.server...]
Also, if needed, add ProxyRequests off for security reasons. You don't want people to be able to use your server to proxy through to other sites. This should be off by default, but try requesting http:www.yourdomain.com/http://yahoo.com/
If it works, you'll need to disable ProxyRequests.
Also, I got in a hurry and forgot the first time, so...
Welcome to WebmasterWorld!
Jim