After reading an article that mentioned that about 40% of the websites work with HTTP/1.1, I was curious about which would be the HTTP version used on my own server. I use Plesk to manage all the websites that I host on a single server, the tool is constantly updated, but to my surprise, my websites were working through HTTP/1.1. A couple of hours later, I read that Plesk does support HTTP/2, however, you need to enable it through the terminal in order to use it.
In this article, I'm going to explain to you how to easily enable support for HTTP/2 in your Plesk based server.
1. Verify that your website doesn't use HTTP/2
Before proceeding to enable the support for HTTP/2 in your server, you need to know if it isn't already enabled. You can use this online tool that verifies if your website supports HTTP/2. Provide your domain name and click on "test":
In this example, our website doesn't use HTTP/2 but HTTP/1.1. Now that we know that our server doesn't provide support for this version, let's proceed to enable it.
2. Check if Nginx is working properly
As you may know, Plesk Obsidian works with Apache and Nginx simultaneously. So in case you didn't know, you will have to verify that the Nginx component is up to date and installed on the server. Go to Plesk, Tools and Settings and Server Components:
If Nginx is installed and proceed to check if the Reverse Proxy Server is active. Go to Plesk, Tools and Settings, and Services Management:
After verifying that the service is installed and running, proceed with the last step.
3. Enable HTTP/2 on Plesk
To enable support for HTTP/2, simply run the following command as root in your server. You will have to log in to the server via SSH and type the following command (be sure to run the command as superuser):
plesk bin http2_pref enable
This will immediately activate HTTP/2 in all the websites hosted on your server and will generate the following output:
You can now verify with the mentioned tool at the beginning of the article that your websites now work with HTTP/2:
If you want to disable support for HTTP/2 in your Plesk server, you may return it back to normal with the following command:
plesk bin http2_pref disable
After running this command, you will have again HTTP/1.1 as the default version of the transport protocol.
Happy coding ❤️!