求助 nginx 开启 http2 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
alittletrain
V2EX    问与答

求助 nginx 开启 http2

  •  
  •   alittletrain 2016-09-21 09:11:21 +08:00 2709 次点击
    这是一个创建于 3357 天前的主题,其中的信息可能已经有所发展或是发生改变。

    证书是 letsencrypt 配置如下

    server { #listen 80; listen 443 ssl http2; server_name areyoufuckingme.com; ssl_certificate /etc/letsencrypt/live/areyoufuckingme.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/areyoufuckingme.com/privkey.pem; ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_session_cache shared:SSL:10m; index index.php index.html index.htm; set $root_path '/Data/areyoufuckingme/public'; root $root_path; location / { try_files $uri $uri/ /index.php?_url=$uri&$args; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location /.well-known { allow all; } } 

    Nginx开启了h2模块

     nginx version: nginx/1.10.0 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) built with OpenSSL 1.0.1e-fips 11 Feb 2013 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-ipv6 --with-http_sub_module --with-ld-opt='-ljemalloc' 

    目前的问题是 ssl 生效了 但是 http2 没生效。。

    好奇怪 只有一个css和js开始H2 剩下的不是h1就是spdy...

    8 条回复    2016-09-21 12:21:55 +08:00
    Leafove
        1
    Leafove  
       2016-09-21 09:34:39 +08:00
    built with OpenSSL 1.0.1e-fips 11 Feb 2013
    lhbc
        2
    lhbc  
       2016-09-21 09:36:37 +08:00
    Chrome 不支持 NPN ,只支持 ALPN
    OpenSSL 1.0.1 系列都不支持 ALPN ,你需要用 OpenSSL 1.0.2h 或者 OpenSSL 1.1.0 来编译 nginx

    另外,你这 gcc 版本够老的……
    kkzxak47
        3
    kkzxak47  
       2016-09-21 09:37:26 +08:00 via Android
    记得 OpenSSL 需要 1.0.2 以上
    DesignerSkyline
        4
    DesignerSkyline  
       2016-09-21 10:01:05 +08:00 via iPad
    发帖前建议搜一下本站,已经有了相关帖子了
    t/286552
    alect
        5
    alect  
       2016-09-21 10:30:33 +08:00
    openssl 版本太低,用最新版编译 nginx
    xiaoz
        6
    xiaoz  
       2016-09-21 11:26:03 +08:00
    楼上的正解,同时您可以参考下: https://www.xiaoz.me/archives/7225
    bazingaterry
        7
    bazingaterry  
       2016-09-21 11:48:35 +08:00
    FlowMEMO
        8
    FlowMEMO  
       2016-09-21 12:21:55 +08:00
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     844 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 23ms UTC 22:31 PVG 06:31 LAX 14:31 JFK 17:31
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86