Check if HTTP/2 enabled using curl

To see if a web site have HTTP/2 enabled, you can run

curl -sI SITE_URL_HERE -o /dev/null -w '%{http_version}\n'

If you see 2, the site have HTTP/2 enabled.

Example

boby@sok-01:~$ curl -sI https://serverok.in/ -o /dev/null -w '%{http_version}\n'
2
boby@sok-01:~$ 

Here is a site with no HTTP/2

boby@sok-01:~$ curl -sI http://ok.serverok.in/ -o /dev/null -w '%{http_version}\n'
1.1
boby@sok-01:~$ 

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *