Dan*_*iel 1 configuration http nginx
我有一个简单的rails应用程序
(browser) -> (nginx latest; proxy_pass) -> rails (latest)
Run Code Online (Sandbox Code Playgroud)
如何配置nginx以通知rails nginx通过不同的头IE IE收到HTTP/2请求:my_"http_version = 2.0"?proxy_pass通过HTTP 1.1与rails通信,我想知道原始请求是否是http/2.
谢谢!
这类似于X-Forwarded-For和X-Forwarded-Proto头文件的使用,但没有用于将HTTP协议版本传递给后端的标准头文件.我建议使用这个:
proxy_set_header X-Forwarded-Proto-Version $http2;
Run Code Online (Sandbox Code Playgroud)
该$http2变量来自ngx_http_v2_module我想你使用的是带有的Nginx服务器的HTTP/2.
之间的差$http2和$server_protocol是,$http2更像一个布尔值,出现空白,如果使用了HTTP/1协议. $server_protocol将包含"HTTP/1.1"或"HTTP/2.0"等值,因此根据您的需要,它也可能是一个不错的选择.
| 归档时间: |
|
| 查看次数: |
3993 次 |
| 最近记录: |