spring-bootnginxnginx-confighttp2nghttp2

Does nginx still have HTTP 1.1 browser access after enabling HTTP 2?


nginx version nginx/1.23.3

openssl version OpenSSL 1.0.2k-fips 26 Jan 2017

nginx config

server {
  listen 80;
  listen 443 ssl http2;
  ssl_certificate /usr/local/nginx/conf/ssl/key.cer;
  ssl_certificate_key /usr/local/nginx/conf/ssl/key.key;

  ssl_session_timeout 5m;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDH$
  ssl_prefer_server_ciphers on;
  ssl_stapling on;
  ssl_stapling_verify on;

#  server_name _;
  server_name  localhost;

  location /fp01/ {
    proxy_pass http://127.0.0.1:31600/;
    proxy_set_header Host $http_host;
  }
}

Browser network enter image description here

  1. May I ask where else do I need to configure to support http2?
  2. Nginx serves as the website portal and acts as a proxy for the backend spring boot. Does the proxy 31600 port program also need to enable support for http2? Or just need the outermost nginx to open?

If the Disable Caching button in the browser is not checked, some requests will display the protocol as h2


Solution

  • Try:

    listen 80 http2;
    listen 443 ssl http2;