http/2 not working

Discussion in 'Plesk Automation Suggestions and Feedback' started by P_heck, Apr 27, 2016.

  1. P_heck

    P_heck Kilo Poster


    following the article, I tried to enable http/2 - but without success. Test at still say that there is no http/2 support enabled.

    • Plesk version 12.5.30 Update #30
    • NGINX version 1.9.14-debian7.0.16040615
    • All websites configured to use NGINX, force https using Let's Encrypt certificates
    While launching the command to enable http/2 like described, no error message occurs.

    Special nginx directives used (example for one deomain - others configured the same way):

    if (!-e $request_filename){
        rewrite ^(.*)$ /index.php break;
    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires 30d;
        add_header Pragma public;
        add_header Cache-Control "public";
        try_files $uri @fallback;
    gzip on;
    gzip_proxied any;
    gzip_types text/plain [s]text/html[/s] text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js;
    gzip_vary on;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";
    if ($request_uri = /) {
        set $test  A;
    if ($scheme = 'http') {
        set $test  "${test}B";
    if ($test = AB) {
        rewrite  ^/(.*)$$1  permanent;
    add_header Strict-Transport-Security max-age=31536000;
    add_header X-Frame-Options SAMEORIGIN;
    I also followed the troubleshooting guide at
    • openssl command proves: only http1.1 is available
    • openssl is in the right version: 1.0.1e-2+deb7u20
    • All websites configured to use SSL
    • NGINX is enabled and used by all websites
    • No custom configuration files exists (no directory /usr/local/psa/admin/conf/templates/custom exists at all)
    • /usr/local/psa/admin/conf/panel.ini only contains one entry which is the one mentioned here :
      nginxHttp2 = true
    Has anyone any idea, how I can trace this to find the problem?

    Cheers Peter
    Last edited: Apr 27, 2016
  2. P_heck

    P_heck Kilo Poster

    Found the problem why the http/2.0 support didn’t work for me:

    The #/usr/local/psa/bin/http2_pref enable command is not inserting the http2 directive in the nginx.conf files at /var/www.vhost/system/domain.tld/conf. It shows for example:

    instead of

    Alo looking at the script /usr/local/psa/bin/http2_pref, I can not see, that any configuration in the nginx.conf is changed to insert the statement itself:

    So assumption is, that it will be applied using the default templates during the reconfigure command.
    Searching in the template directory for "http2", I found following entry in /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php :

    server {
        listen <?php echo $OPT['ipAddress']->escapedAddress . ':' . $OPT['frontendPort'] .
            ($OPT['default'] ? ' default_server' : '') . ($OPT['ssl'] ? ' ssl' : '') .
            ($OPT['ssl'] && $VAR->domain->physicalHosting->proxySettings['nginxHttp2'] ? ' http2' : '') ?>;
    Not sure, what is the trigger to set the ssl in the right way here.

    Here a screenshot of the config of one domain:


    @Plesk Support: Can you have a look at this?
    Last edited: Apr 28, 2016

Share This Page