Nginx Warn: the "listen ... http2" directive is deprecated (1.25.1+)

Nginx 1.25.1+ replaced `listen 443 ssl http2;` with standalone `http2 on;`.

Runs locally in browser Free · No login Independently Verified 2026-11-25 v4.1.0
Identifier: Nginx Warn Platform: Nginx
Common Root Causes:
  • Nginx 1.25.1+ replaced `listen 443 ssl http2;` with standalone `http2 on;`.

Interactive Diagnostic Checklist

Verified Solutions:
  1. Replace `listen 443 ssl http2;` with `listen 443 ssl; http2 on;` in the server block.
Safe Diagnostic Command:
nginx -v && nginx -t
Warning: Verify configuration changes in staging or with dry-run flags (e.g. nginx -t) before reloading production services.

Technical Explanation

Nginx 1.25.1+ replaced `listen 443 ssl http2;` with standalone `http2 on;`. Recommended diagnostic: `nginx -v && nginx -t`. Remediation: Replace `listen 443 ssl http2;` with `listen 443 ssl; http2 on;` in the server block.

Worked Examples

  • Run `nginx -v && nginx -t` to verify root cause before applying the remediation.

Limitations & Assumptions

  • Always verify configuration changes in staging or with dry-run flags (e.g. `nginx -t`) before reloading production services.

Source References & Verification

Resource ID: err-nginx-http2-deprecated-directive · Independently verified: 2026-11-25

Related Resources