解决 the “listen … http2” directive is deprecated

  • 发表于
  • 后端

错误

nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead

解决方法

检查现有配置形式如:

server {
listen443 ssl http2;

修复:nginx >= 1.25.1 的新格式为

server {
listen443 ssl;
http2on;

更多参考:https://github.com/nginxinc/kubernetes-ingress/issues/4237