How do I know if my website is being served over HTTP or HTTP/2?
Apache doesn't have to support it. The Chrome extension reads the HTTP headers to determine that.
Another method is simply to look at the network tab > headers > response headers > view source in Chrome or Firefox. There the headers can be seen. It should read "HTTP/2" or some sort I can't recall right now.
Easiest: You can use curl -I <your site>
which will put the HTTP response as the first line.
HTTP/2.0 200
server:nginx
date:Fri, 29 Apr 2016 14:31:40 GMT
content-type:text/html; charset=utf-8
content-length:7629
last-modified:Thu, 07 Apr 2016 02:41:08 GMT
....
Here's another method that may be easier, if you don't have ready access to command-line and cURL, or you're navigating several layers of CDN (e.g. if your HTTP/2 is being provided by a provider like CloudFlare).
- Open Chrome Dev Tools (Ctrl-Shift-I)
- Open the Network tab
- If your page has already loaded, you may need to refresh (Ctrl-R)
- Right-click on the header row of the request list (the row labelled: Name, Method, Status, etc.)
- Select Protocol from the context menu.
- You may need to refresh again (Ctrl-R), and you will see all the protocols being used.
If you see h2
, then congratulations! Your website is being served over HTTP/2.
For people using Nginx, you can view the access log which is usually located at /var/log/nginx/access.log
and look for lines like
167.220.232.9 - - [12/Feb/2018:15:09:04 +0800] "GET / HTTP/2.0" 200 2546 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299"