If you have to develop behind a proxy server, you may have encountered the following problem;
The ColdFusion (JRUN) JVM settings allow one to specify a proxy server, allowing your local ColdFusion to connect to external public URLs. However there is no proxy by-pass options, so when configured your ColdFusion cannot connect to local URLs which are not resolved by the proxy server, i.e. local development servers.
The following solution uses Apache to create a local proxy server for your local ColdFusion to use;
Apache Setup
- Enable mod_proxy for Apache by un-commenting the following modules to load in your httpd.conf file. If you do not have the mod_proxy module, then you will need to install it.
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so (required for cfhttp)
- Add the following virtual host configuration to your local httpd-vhosts.conf file
# Local Proxy for ColdFusion
Listen 8080
<VirtualHost *:8080>
DocumentRoot D:\InetPub\wwwroot
ServerName localhost
ProxyRequests On
ProxyVia On
ProxyRemote * http://your-proxy-server:8080
NoProxy .local 192.168
</VirtualHost>
- Restart Apache
ColdFusion Setup
- Edit ColdFusion (cfusion) JVM settings in your local JRun4 admin (or CF Admin for non JRun install) to add the following proxy setting
-DproxySet=true -Dhttp.proxyHost=localhost -Dhttp.proxyPort=8080
- Restart cfusion instance