为什么$ _ SERVER [" SERVER_PROTOCOL"]显示HTTP / 1.0当客户说话HTTP / 1.1 [英] Why does $_SERVER["SERVER_PROTOCOL"] show HTTP/1.0 when the client spoke HTTP/1.1

查看:720
本文介绍了为什么$ _ SERVER [" SERVER_PROTOCOL"]显示HTTP / 1.0当客户说话HTTP / 1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道的HTTP版本用于连接到我的服务器的用户。在code。在 http://test.yccau.com (PHP 5.3.26和Apache 2.2.24 )看起来是这样的:

I'm trying to know the HTTP version the user used to connect to my server. The code at http://test.yccau.com (PHP 5.3.26 and Apache 2.2.24) looks like this:

<?php
    echo $_SERVER["SERVER_PROTOCOL"];
?>

由于某些原因,该页面显示 HTTP / 1.0 即使在请求和响应均 HTTP / 1.1

什么可能导致的吗?我们怎样才能把HTTP版本的Web客户端用来连接到服务器?

What may be causing the problem? How do we get the HTTP version the web-client use to connect to the server?

推荐答案

有趣的问题!你有两个连接在这里,因为你在之间的终点代理。从 nginx的的版本阿帕奇请求将会通过HTTP 1.0。

Interesting problem! You have two connections here because you have a end-point proxy in between. The request from your version of nginx to apache is going over HTTP 1.0.

CLIENT <---- (HTTP 1.1) ----> NGINX <----- (HTTP 1.0) ----> SERVER

Nginx的 1.1.4起支持 HTTP 1.1 上游服务器。

这篇关于为什么$ _ SERVER [&QUOT; SERVER_PROTOCOL&QUOT;]显示HTTP / 1.0当客户说话HTTP / 1.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆