簡體   English   中英

http2 在協議中顯示 http1

[英]http2 shows http1 in protocol

我已經使用“讓我們加密”在 nginx 上設置了 https,但不清楚在訪問站點時是否使用了 http2。

我通過添加 listen [::]:443 ssl http2 default_server; 來啟用 http2; 到 nginx 配置

當我在 Chrome 開發人員工具(查看 -> 開發人員 -> 開發人員工具)中檢查站點的 https 協議並重新加載頁面(查看 -> 重新加載此頁面)時。 然后導航到網絡選項卡,單擊以名稱開頭的表標題行,右鍵單擊它,然后選擇協議選項。

它說 http/1.1 而不是 http2 的 h2。 但是對於我通過 google.com 訪問的 Google 字體,它說 h2 而在https://tools.keycdn.com/http2-test檢查域時,它說該站點支持 http2

當我運行 curl --http2 -I https://example.com/我得到 curl: (1) Unsupported protocol

所以我在這里有點困惑。

我是否需要做更多事情才能使其與 http2 一起使用?

這是我完整的NGINX配置文件:

server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;

include snippets/ssl-www.example.com.conf;
include snippets/ssl-params.conf;

root /var/www/html;
index index.php index.html index.htm;

server_name example.com;

#Password protects the test subdomain
##  auth_basic "Restricted Content";
##  auth_basic_user_file /etc/nginx/.htpasswd;

location ~ /.well-known {
allow all;
}
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
# include /etc/nginx/naxsi.rules
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
# Mitigate https://httpoxy.org/ vulnerabilities
fastcgi_param HTTP_PROXY "";
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
include fastcgi_params;
}
location ~ \.php$ {
#match actual filename with extension or file not found
#try_files $uri $uri =404;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
server {
listen [::]:80 default_server ipv6only=on;
listen 80 default_server;
server_name www.example.com;
return 301 https://example.com$request_uri;
}

為了您的信息,我在設置 Let's Encrypt 時遵循了本教程:digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04

nginx 版本:nginx/1.10.0 (Ubuntu 16.04)

我正在 Windows 10 最新版 Chrome 上進行測試

ssllabs.com/ssltest 顯示: TLS 1.2 是 TLS 1.1 是 TLS 1.0 是 SSL 3 否 SSL 2 否

握手模擬 IE 11 / Win 10 R RSA 2048 (SHA256) TLS 1.2 > h2 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 ECDH secp384r1 FS

協議詳細信息:SSL 2 握手兼容性是 HTTP 請求:(HTTP/1.1 200 OK) NPN 是 h2 http/1.1

對於仍在尋找但尚未閱讀評論的人:

嘗試禁用Bitdefender SSL 掃描Bitdefender 加密網絡掃描

@BazzaDP Ah 由 Bitdefender 發布...!... :-) 看來您是對的... – Gabriel 17 年 1 月 29 日 8:54 1

謎團已揭開! 當我在 Bitdefender 中禁用 SLL 掃描時,我的網站現在顯示 h2..!.. 所以代碼一直都是正確的,只是我的防病毒程序......謝謝@BassaDP !!! – 加布里埃爾 17 年 1 月 29 日 9:20

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM