1
yeyeye 2015-10-14 22:39:56 +08:00
帮你谷歌了下,小弟的建议是一字不差的抄过去,看了几个都是一样的配置方法,只能建议您把 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 我,最好是忽视我的存在 |
2
tms 2015-10-14 23:35:06 +08:00
https://tms.im/tms/nginx-http2
推广自己 blog 的好时候 |
3
Andy1999 OP @yeyeye
@tms [root@localhost ~]# 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 [root@localhost ~]# 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 [root@localhost ~]# cat /usr/local/nginx/conf/vhost/dl.andy1999.com.conf server { listen 80; #listen [::]: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; #error_page 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; #include 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; |
4
Andy1999 OP 然而并无卵用 日了妹了
|
5
udumbara 2015-10-15 02:44:59 +08:00
已成功配置
[升级 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/) |
6
Joming 309 天前
不喜欢折腾了,直接套个 CDN 解决。
|