(Note: I’m cleaning up some old drafts which have been sitting around for awhile.)
A couple of years ago while setting-up a new J2EE server cluster using the Implementing Multitier Hardware Load Balancing with ColdFusion MX for J2EE or JRun article, I needed to setup a proxy filter for ColdFusion requests. Given that the application I was setting up used a context root of /, the proxy rule listed in that article would not work. Instead, thanks to my former co-worker Rod, I now have a regular expression which will redirect all basic requests for ColdFusion:
- ^((?:\S*.cfml?\S*)|\S*/(?:\?\S+)?)$
This regexp works for the following combinations:
- hello.cfm?hello=2
- hello/
- sadfa/
- dasd/?hello=231
- xo.cfm/hello
- hello/dookie.cfm
- dookie/hello.cfm?thisvar=dookie
- /
And the following requests are not proxied:
- /hello.html
- hello.html
- hello/hello.html
Obviously these are just basic test cases, but it should leave all CSS, image, JavaScript, etc. type requests to the webserver, and pass on everything else to the app servers. You would also need to change it to include direct requests for .cfc files if you’re doing anything like Flash Remoting, Web Services, etc directly to CFC’s.
By Rod April 3, 2008 - 9:36 am
Yo B, thanks for the link, but it goes to my broken blog address. For anyone who clicks that link and finds it broken, the real site is http://www.nomachetejuggling.com
By Brandon Harper April 3, 2008 - 3:50 pm
Fixed. It was a very old "draft", so it had your old URL in it still I guess.