Skip to main content

Enable HTTP2 on NGINX

Comments

24 comments

  • cPRex Jurassic Moderator
    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
  • tbutler
    @cPRex thank you! I'll submit that right now!
    0
  • Kholodny
    Hello, guys! I create feature request about it! Pls vote)
    0
  • tbutler
    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
  • cPRex Jurassic Moderator
    I'll poke that team and make sure the first one gets approved :D
    0
  • cPRex Jurassic Moderator
    0
  • Nirjonadda
    @cPRex Also Please add
    0
  • cPRex Jurassic Moderator
    @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
  • Nirjonadda
    @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.

    Done here:
    0
  • cPRex Jurassic Moderator
    Thanks - I've messaged our team that handles those so that will be approved soon.
    0
  • sahostking
    Is this implemented in the new cPanel version with 100 atm? If not can it be done via /etc/nginx/nginx.conf globally?
    0
  • sahostking
    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
  • cPanelAnthony
    Thank you for this confirmation!
    0
  • Nirjonadda
    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
  • Nirjonadda
    @sahostking This edit http2.conf files will be removed after cPanel/nginx update. So cPanel should implemented http2 support for nginx by default.
    0
  • cPanelAnthony
    @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
  • Kholodny
    Hello! If you would like to see this functionality added, could you submit a feature request via the link in my signature?

    haha, seriously?
    0
  • cPanelAnthony
    haha, seriously? Enable HTTP2 globally for ea-nginx
    0
  • uk01
    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 1
    0
  • cPRex Jurassic Moderator
    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
  • Scott Greczkows
    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
  • cPRex Jurassic Moderator
    Since we don't officially support it with Nginx on cPanel, I don't have any ideas on that part, unfortunately.
    0
  • Scott Greczkows
    I was under the impression from Cpanel Anthony that it was.
    0
  • cPRex Jurassic Moderator
    Officially no, the feature was never implemented:
    0

Please sign in to leave a comment.