I'm developing a PHP web application that needs to send out a file in a server specific way, like so:
<?php
$server = get_upstream_web_server();
if ($server === 'nginx') {
header('X-Accel-Redirect: smiley.png');
}
else if ($server === 'apache') {
header('X-Sendfile: smiley.png');
}
else {
echo file_get_contents('smiley.png');
}
Is there a way to get the name of the upstream server like the get_upstream_web_server()
in the above example?