技术解析

Nginx 的 HTTP2 谁配置成功了?
0
2021-05-25 17:32:29
idczone
编译 Nginx1.9.5 加入了 http_v2_module
ope美国服务器nssl 升级到了 1.0.2
listen 443 ssl http2 依然无效
请问有人成功过吗?求教程啊
帮你谷歌了下,小弟的建议是一字不差的抄过去,看了几个都是一样的配置方法,只能建议您把 nginx 的支持功能列表查看一下(小弟记得可以查看编译了多少包进去,就知道支持啥功能了)
server {
listen 443 ssl http2 default_server;
ssl_certificate server.crt;
ssl_certificate_key server.key;
...
}
来源
http://www.cnbeta.com/articles/434667.htm
https://imququ.com/post/nginx-http2-patch.html
https://winclient.cn/nginx-1-9-5-release-support-http2/
免责条款
小弟是菜鸟,表打我,表 bLoCk 我,最好是忽视我的存在

https://tms.im/tms/nginx-http2
推广自己 blog 的好时候


[[email&~]nginx -V
nginx version: nginx/1.9.5
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (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
Last login: Mon Oct 12 22:15:54 2015 from 125.227.87.232
[[email&~]nginx -V
nginx version: nginx/1.9.5
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (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
[[email&~]cat /usr/local/nginx/conf/vhost/dl.andy1999.com.conf
server
{
listen 80;
[::]:80;
server_name dl.andy1999.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/dl.andy1999.com;
include other.conf;
404 /404.html;
location ~ [^/]\.php(/|$)
{
comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
pathinfo.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/dl.andy1999.com.log access;
}
server {
listen 443 ssl http2;
server_name dl.andy1999.com ;
ssl on;
ssl_certificate /usr/local/nginx/conf/vhost/andy1999.com.crt;
ssl_certificate_key /usr/local/nginx/conf/vhost/andy1999.com.key;
ssl_dhparam /usr/local/nginx/conf/vhost/dhparam.pem;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_stapling on;
ssl_ciphers "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA";
ssl_prefer_server_ciphers on;

add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/dl.andy1999.com;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}

location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /home/wwwlogs/dl.andy1999.com.log access;

然而并无卵用 日了妹了

已成功配置
[升级 Nginx,加入对 HTTP2 的支持]( https://shanjie.me/2015/10/15/%E5%8D%87%E7%BA%A7Nginx-%E5%8A%A0%E5%85%A5%E5%AF%B9HTTP2%E7%9A%84%E6%94%AF%E6%8C%81/)

数据地带为您的网站提供全球顶级IDC资源
在线咨询
专属客服