We are running SugarCRM CE behind a firewall, and due to other concerns, it can not be accessed via standard port 80, but can be accessed on 8080.

Since many customers of ours have sophisticated firewalls, they can not always access port 8080 for tracking. After reading the documentation at

Tracking Campaign Activities When Sugar Is Behind a Firewall - SugarCRM Support Site
and
Advanced Configuration Options - SugarCRM Support Site

I decided to put this code in an accessible url on our web site. I have found several things, first of which is that how php handles single and double quotes is different than just about everything I've ever touched.
Second thing I found is that the code on either of those 2 links has several syntax errors. The final code that I was able to get to run without errors is as follows.

<?php
if ($_REQUEST['entryPoint'] == 'removeme' || $_REQUEST['entryPoint'] == 'campaign_trackerv2' || $_REQUEST['entryPoint'] == 'image') {
if (strlen($_REQUEST['identifier']) == 36) {
$ch = curl_init();
if (strlen($_REQUEST['track']) > 0) {
curl_setopt ($ch, CURLOPT_URL, "http://mysugar.XXXXX.com:8080/index.php?entryPoint=\\" . $_REQUEST['entryPoint'] . "&identifier=\\" . $_REQUEST['identifier'] . "&track=\\" . $_REQUEST['track']);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER[HTTP_USER_AGENT]);
$headers = curl_exec($ch);
$headerArray = explode("\n\\",$headers);
foreach ($headerArray as $value) {
if (substr(strtolower($value),0,8) == "location\\") {
header($value);
}
}
}
else
{
curl_setopt($ch, CURLOPT_URL,'http://mysugar.XXXXX.com:8080/index.php?entryPoint=\\' . $_REQUEST[entryPoint] . '&identifier=\\'.$_REQUEST[identifier]);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER[HTTP_USER_AGENT]);
curl_exec($ch);
}
curl_close($ch);
unset($ch);
}
}
?>

Of course, after sending 2 quick test campaigns, it doesn't work. I did create a tracking link embedded into a graphic available on the web site, and a removal link in the email template pointing to the URL of the web site. I do not get any errors from the php script on the web host. According to the hosting company, my site does not have any restrictions on outbound traffic above port 1024. But I don't see any tracking information in SugarCRM. I have confirmed that the system is accessible from outside on port 8080.

The browser does "spin", but it completes to a blank page. I remember seeing a thread on a custom remove url redirect, and I might try that after I know I'm getting data. However, the site CMS is Wordpress, and I hate having URL's outside the Wordpress schema/template.

A quick check didn't come up with any obvious Wordpress plugins that addressed this part of SugarCRM - Am I missing something? I don't need forms/contact capture/cart/commerce features, not our business style.

Suggestions on which logs to look at for the connection (short of Apache - FYI I'm running the Bitnami VM, but I'd love to "uninstall" all the Bitnami hacks and get it back to Ubuntu).
Suggestions on other places to start troubleshooting?
How much of the URL do I put into the location of the tracking files under Administration/Campaign Email settings?
Is there someone out there who has better code or could double check the above? I'm not much of a php phreak.

Thanks!