A little background: I have a form on a public website that needs to post data to an Apache server behind my firewall. I don't want to provide direct access to this webhost from the internet.
Currently this is what I'm doing: I have an IIS server in my DMZ. This IIS server is the only IP allowed to access the Apache server through the firewall. As a temporary solution I set up IIS with "Application Request Routing" to present the Apache box through IIS to the internet.
What I would like to do: Have some way to capture and then relay the form without having to present the Apache box to the internet. The trick here is that the POST will come from anywhere on the internet, be grabbed by the IIS server, and then relayed from the IIS server to the apache box. I've looked into doing this with PHP/cURL but am not sure if using something like this will do the trick:
<?php
$todo = "";
while (list($name, $value) = each($HTTP_POST_VARS)) {
$todo.=$name."=".$value."&";
}
$ch = curl_init('http://mylanserver/capture.php');
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $todo);
curl_exec ($ch);
curl_close ($ch);
?>
Can someone point me in the right direction? Thanks.