VPS侦探论坛

 找回密码
 注册
查看: 4274|回复: 2

安装lnmp1.8遇到的http2支持问题!!!

[复制链接]
发表于 2021-8-31 18:04:31 | 显示全部楼层 |阅读模式

本帖最后由 fxemul70324 于 2021-8-31 18:08 编辑

选择lnmp1.8进行安装一路默认,在nginx中配置了 listen 443 ssl http2;用curl -I xxxx.com测试的时候显示的还是http1.1
执行nginx -V后如下
nginx version: nginx/1.20.1
built by gcc 8.4.1 20200928 (Red Hat 8.4.1-1) (GCC)
built with OpenSSL 1.1.1k  25 Mar 2021
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_gzip_static_module --with-http_sub_module --with-stream --with-stream_ssl_module --with-openssl=/home/xxxx/tools/lnmp1.8/src/openssl-1.1.1k --with-openssl-opt='enable-weak-ssl-ciphers'


https的配置是用的阿里云的免费证书配置;nginx的配置是直接复制了一份http的server改的

不知道是哪里出了问题???





补充内容 (2021-8-31 21:36):
免费证书配置参照:https://help.aliyun.com/document_detail/98728.html?spm=5176.b657008.help.dexternal.641556a72UrNPB
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2021-9-1 08:18:01 | 显示全部楼层


lnmp vhost add 添加虚拟主机自动生成的配置就是支持的

首先curl命令参数你都没用对,你curl使用http2需要添加参数 --http2 你都不加肯定走默认的http1.1
其次你自己curl版本是否不支持http2,可以自己 curl --version 查看
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2021-9-1 08:42:58 | 显示全部楼层

licess 发表于 2021-9-1 08:18
lnmp vhost add 添加虚拟主机自动生成的配置就是支持的

首先curl命令参数你都没用对,你curl使用http2需要 ...

我以为开启http2之后,命令行访问的时候会默认走http2呢;昨天我用chrome、edge浏览器访问的时候看了一下走的是http1.1协议,以为失败了,刚才强制刷新后出现了h2。

在win10下curl的版本是
curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
Release-Date: 2017-11-14, security patched: 2019-11-05
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL
直接curl -I -http2 https://www.xxx.com 提示不支持的协议,

刚才去server端执行了curl -I https://www.xxx.com提示如下:
HTTP/2 200
server: nginx
date: Wed, 01 Sep 2021 00:42:08 GMT
...

一会去升级下win的curl看看。

谢谢军哥解答
初步判定是win的curl可能是有问题,一会升级看看。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-20 20:25 , Processed in 0.026527 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表