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

  nginx 1.25.1부터 listen 지시문에 http2이 들어가면 아래와 같은 경고문이 나올 수 있다.

$ nginx -t
nginx: [warn] the "listen ... http2" directive is deprecated, use the "http2" directive instead in /etc/nginx/conf.d/???.conf:2

  nginx 새 판에서 listen 지시문에 들어가는 매개변수에 http2을 받아들이지 않을 것임을 예고하고 있다. 아직은 경고문이 나오고 작동은 하지만, 나중에 나오는 nginx 판에서는 오류문를 뱉고 nginx가 실행되지 않을 수 있다.

  nginx.conf 또는 경고문에 나오는 conf 파일을 열어 본다.
server {
listen 443 ssl http2;

  listen 지시문에서 http2을 빼고, http2 지시문(http2 on;)을 새로 넣는다.

server {
listen 443 ssl;
http2 on;

  이렇게 고치고 나서 'nginx -t'로 확인해 보면 비권장 경고문(Deprecated)은 나오지 않는다.

2023/06/18 00:15 2023/06/18 00:15
글 걸기 주소 : 이 글에는 글을 걸 수 없습니다.

덧글을 달아 주세요