我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

有没有办法用PHP确定上游Web服务器?

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?

See $_SERVER['SERVER_SOFTWARE'].

近期文章

  • 可以在Redis中存储渲染的html吗? [关闭]
  • 需要帮助显示数据库中的数据
  • 在Opencart 2.3的首页检测Admin
  • 以PayPal格式传递自定义数据
  • PHP数组到HTML表问题
  • 从MySQL查询创建新数组
  • 如何在WHMCS发票模板文件invoicepdf.tpl中获取产品组详细信息?
  • 包括标题页会话错误
  • 将图像插入/上传到tinyMCE 4.X
  • 用php替换文本文件中的值
  • 阻止CURL访问特定页面
  • symfony AccessDeniedException始终重定向到登录页面
  • 如何创建一个基于URL加载内容的页面[关闭]
  • 如何在Windows 10命令提示符下运行PHP脚本时打印出平方根符号?
  • 无法使用curl上传文件[关闭]
  • 在SugarCRM 7.x中删除自定义模块的子面板
  • PHP如何使用foreach从数组中获取值
  • 插入事件时缺少Google日历的结束时间
  • 在laravel 5中从url params为模型添加值
  • PHP从数据库导出CSV表

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华