Enable HTTP2 on NGINX
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!
-
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. 0 -
@cPRex thank you! I'll submit that right now! 0 -
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. :-\ 0 -
I'll poke that team and make sure the first one gets approved :D 0 -
@Nirjonadda - I wish I had those magic powers! I'd recommend submitting a feature request if you'd like to see that added to the product. 0 -
Thanks - I've messaged our team that handles those so that will be approved soon. 0 -
Is this implemented in the new cPanel version with 100 atm? If not can it be done via /etc/nginx/nginx.conf globally? 0 -
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 :) 0 -
Thank you for this confirmation! 0 -
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.0 -
@sahostking This edit http2.conf files will be removed after cPanel/nginx update. So cPanel should implemented http2 support for nginx by default. 0 -
@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?0 -
haha, seriously? Enable HTTP2 globally for ea-nginx
0 -
Excellent ! This is also working for me. cPanel should implemented http2 support for nginx by default.
Does yours still show as http1.1 in Apache status? I guess this is because when nginx is http2 Apache goes to 10 -
Yes, when I check with curl on one of my personal websites on a server using Nginx, I see this: $ curl --head https://somedomain.com HTTP/1.1 200 OK Server: nginx Date: Thu, 24 Mar 2022 15:47:39 GMT Content-Type: text/html; charset=UTF-8 Connection: keep-alive
0 -
If I out in server { listen 443 ssl http2; listen [::]:443 ssl http2; }
I get the message... nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/http2.conf:3 nginx: [warn] protocol options redefined for 0.0.0.0:443 in /etc/nginx/conf.d/http2.conf:3 nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/http2.conf:4 nginx: [warn] protocol options redefined for [::]:443 in /etc/nginx/conf.d/http2.conf:4 Any ideas?0 -
Since we don't officially support it with Nginx on cPanel, I don't have any ideas on that part, unfortunately. 0
Please sign in to leave a comment.
Comments
24 comments