'nginx(1.16.1) doesn't respond incoming requests with http2 protcol

here my setup : CentOS Linux release 7.9.2009 (Core), nginx/1.16.1 , OpenSSL 1.0.2k-fips

I want to respond all requests to my website using http2 protocol and I already enabled TLS but still respond in http1 format

Also consider : No ALPN negotiated

    echo | openssl s_client -alpn h2 -connect mywebsite:443 | grep ALPN
    depth=1 C = PL, O = Unizeto Technologies S.A., OU = Certum Certification Authority, CN = 
    Certum Domain Validation CA SHA2
    verify error:num=20:unable to get local issuer certificate
    DONE
    No ALPN negotiated

and below is my nginx configuration :

server {
    listen       443 ssl http2;
    server_name  www.servername.com;
    root         /path;
    index index.html

    proxy_set_header X-Forwarded-Port 443;  
    gzip_static on;

    ssl_certificate "/etc/pki/nginx/server.crt";
    ssl_certificate_key "/etc/pki/nginx/server.key";
    ssl_session_cache shared:SSL:1m;
    ssl_session_timeout  10m;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

 location /developer-portal/
    {
            limit_req zone=ip burst=10 nodelay;   
    add_header 'Access-Control-Allow-Origin'  'https://severname.com';
            proxy_pass https://IPaddress:443;
    }

    location / {
           # limit_req zone=ip burst=10 nodelay;
        add_header Content-Security-Policy "default-src 'self'; script-src 'self'; img-src 'self' data: blob: ; style-src 'self' 'unsafe-inline'; font-src 'self' data:; frame-src 'self'; connect-src 'self' ; object-src 'none' ";
    try_files $uri $uri/ /index.html;       
    }

    error_page 404 /404.html;
    location = /404.html {
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    }
}

what is my solution?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source