Why does $_SERVER[“SERVER_PROTOCOL”] show HTTP/1.0 when the client spoke HTTP/1.1

前端 未结 1 1365
悲&欢浪女
悲&欢浪女 2021-01-20 04:36

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:



        
相关标签:
1条回答
  • 2021-01-20 04:50

    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 onwards supports HTTP 1.1 to upstream servers.

    0 讨论(0)
提交回复
热议问题