tbutler

Well-Known Member
Feb 11, 2004
59
9
158
Is there a way to enable http2 by default on ea-nginx on WHM 94? I can go into each domain's .conf file in /etc/nginx/conf.d/ and add "http2" for connections to port 443, but this seems inefficient (and also at risk of being disabled with a future server update). I'm trying to wring every bit of server performance out of my system as possible -- web pages are loading too slowly -- and so adding http2 into the mix seems like a good idea... Thanks!
 
  • Like
Reactions: nasthik

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,597
2,617
363
cPanel Access Level
Root Administrator
Hey there! I did some testing on my end and I'm not finding a good way to automate this work. One thing you can check is to make your changes and then run "/scripts/upcp --force" to see if they get overwritten.

This would be a great feature request if you wanted to submit one using the link in my signature.
 

tbutler

Well-Known Member
Feb 11, 2004
59
9
158
I can't seem to load yours at that link, @Kholodny. I had created one the day before and it apparently was never approved by the moderator, either. :-\
 

sahostking

Well-Known Member
May 15, 2012
403
29
78
Cape Town, South Africa
cPanel Access Level
Root Administrator
Twitter
Ignore my previous message:

I followed an article from cPanel that helped.

Procedure
To enable this globally, add a new file ending in .conf such as http2.conf to the Nginx configuration folder located in /etc/nginx/conf.d and add the following contents.



server {

listen 443 ssl http2;
listen [::]:443 ssl http2;

}


Save the file and verify the Nginx configuration. Then, restart Nginx as well as PHP-FPM.

nginx -t

/scripts/restartsrv_nginx ; /scripts/restartsrv_apache_php_fpm

I then checked my file:
tail -f /var/log/nginx/access.log

and it showed:

HTTP/2.0

Even gtmetrix reported all is good now with http2 :)
 

Nirjonadda

Well-Known Member
May 8, 2013
759
28
78
cPanel Access Level
Root Administrator
Ignore my previous message:

I followed an article from cPanel that helped.

Procedure
To enable this globally, add a new file ending in .conf such as http2.conf to the Nginx configuration folder located in /etc/nginx/conf.d and add the following contents.



server {

listen 443 ssl http2;
listen [::]:443 ssl http2;

}


Save the file and verify the Nginx configuration. Then, restart Nginx as well as PHP-FPM.

nginx -t

/scripts/restartsrv_nginx ; /scripts/restartsrv_apache_php_fpm

I then checked my file:
tail -f /var/log/nginx/access.log

and it showed:

HTTP/2.0

Even gtmetrix reported all is good now with http2 :)
Excellent ! This is also working for me. cPanel should implemented http2 support for nginx by default.

ScreenShot00418.png
 
  • Like
Reactions: cPanelAnthony

cPanelAnthony

Administrator
Staff member
Oct 18, 2021
1,041
112
118
Houston, TX
cPanel Access Level
Root Administrator
@sahostking This edit http2.conf files will be removed after cPanel/nginx update. So cPanel should implemented http2 support for nginx by default.
Hello! If you would like to see this functionality added, could you submit a feature request via the link in my signature?
 

Kholodny

Member
Nov 30, 2020
10
2
3
Moscow
cPanel Access Level
Root Administrator
Hello! If you would like to see this functionality added, could you submit a feature request via the link in my signature?
haha, seriously?
I shared this idea 8 months ago. Maybe it's time to start reading customer suggestions and implementing them?)
 

cPanelAnthony

Administrator
Staff member
Oct 18, 2021
1,041
112
118
Houston, TX
cPanel Access Level
Root Administrator
haha, seriously?
I shared this idea 8 months ago. Maybe it's time to start reading customer suggestions and implementing them?)
My sincerest apologies for that oversight; things have been hectic with the recent AutoSSL issues. Could you let me know if the steps in the following article work for you? I am giving our dev team a poke about this being a highly requested implementation by default.

Enable HTTP2 globally for ea-nginx