<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 了解http2協議 1. HTTP 2.0 的主要目標是改進傳輸性能,實現低延遲和高吞吐量。從另一方面看,HTTP 的高層協議語義并不會因為這次版本升級而受影響。 **所有HTTP 首部、值,以及它們的使用場景都不會變**。 2. 現有的任何網站和應用,無需做任何修改都可以在HTTP 2.0 上跑起來。不用為了利用HTTP 2.0 的好處而修改標記。HTTP 服務器必須運行HTTP 2.0 協議,但大部分用戶都不會因此而受到影響 。 ## 編譯nginx的http2模塊 通過 `/usr/local/nginx/sbin/nginx -V ` (注意是大寫的V),查看當前nginx是否支持http2:**--with-http_v2_module** ``` nginx version: nginx/1.14.0 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) built with OpenSSL 1.0.2o 27 Mar 2018 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=/usr/local/src/lnmp1.5/src/openssl-1.0.2o ``` 如果沒有的話在編譯nginx時要加上這一行 ``` ./configure \ --user=www \ --group=www \ --with-http_v2_module \ --with-http_ssl_module \ --with-stream \ --with-openssl=./openssl-OpenSSL_1_1_0e \ --with-pcre=./pcre-8.40 --with-pcre-jit \ --with-zlib=./zlib-1.2.11 make && make install ``` ## 生成證書 可以參考我上一篇博文,申請免費證書。也可以手動生成一個偽證書 ``` cd /usr/local/nginx/conf/ mkdir key && cd key openssl genrsa -des3 -out server.key 1024 openssl req -new -key server.key -out server.csr (根據提示隨意的輸入) openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt ``` 最終生成 ``` [root@zhouzhou_01 key]# ll 總用量 8 -rw-r--r-- 1 root samba 0 6月 14 10:41 server.crt -rw-r--r-- 1 root samba 749 6月 14 10:41 server.csr -rw-r--r-- 1 root samba 963 6月 14 10:39 server.key ``` ## 配置nginx 主要配置段如下 ``` server { listen 80; server_name site.com www.site.com; add_header Strict-Transport-Security max-age=31536000; return 301 https://www.site.com$request_uri; } server { listen 443 ssl http2; server_name www.site.com; root /var/www/html/site; index index.php index.html index.htm; access_log /var/log/dnmp/nginx.site.access.log main; error_log /var/log/dnmp/nginx.site.error.log warn; ssl on; ssl_certificate /etc/nginx/conf.d/certs/site/www.site.com.crt; ssl_certificate_key /etc/nginx/conf.d/certs/site/www.site.com.key; ssl_prefer_server_ciphers on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !RC4"; add_header Strict-Transport-Security max-age=31536000; } ``` ## 驗證 - 使用Chrome訪問啟用http2的站點。 - 新開TAB頁,在地址欄中輸入chrome://net-internals/#http2,檢查HTTP/2 sessions下的表格。 - 確認表格里是否出現了上一步訪問的主機地址。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看