본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

ngx_http_v3_module 모듈

원문 보기 위키 갱신

ngx_http_v3_module 모듈 (1.25.0)은 HTTP/3에 대한 실험적(experimental) 지원을 제공해요.

이 모듈은 기본적으로 빌드되지 않으므로, --with-http_v3_module 구성 매개변수로 활성화해야 해요.

이 모듈은 OpenSSL 라이브러리 버전 1.1.1 이상이 필요해요.

0-RTT 지원은 OpenSSL 라이브러리 버전 3.5.1 이상이 필요해요. 또는 BoringSSL, LibreSSL, 또는 QuicTLS 라이브러리를 사용해 이 모듈을 빌드하고 실행할 수 있어요.

출처: 문서

본문

알려진 문제 (Known Issues)

이 모듈은 실험적이며, 구매자는 주의(caveat emptor)가 적용돼요.

버전 1.29.1 이전에는 ssl_early_data 지시어 값과 관계없이 OpenSSL로 0-RTT 지원을 활성화할 수 없었어요.

이 모듈은 Win32 플랫폼에서는 빌드할 수 없어요.

예시 구성 (Example Configuration)

http {
    log_format quic '$remote_addr - $remote_user [$time_local] '
                    '"$request" $status $body_bytes_sent '
                    '"$http_referer" "$http_user_agent" "$http3"';

    access_log logs/access.log quic;

    server {
        # for better compatibility it's recommended
        # to use the same port for http/3 and https
        listen 8443 quic reuseport;
        listen 8443 ssl;

        ssl_certificate     certs/example.com.crt;
        ssl_certificate_key certs/example.com.key;

        location / {
            # used to advertise the availability of HTTP/3
            add_header Alt-Svc 'h3=":8443"; ma=86400';
        }
    }
}

지시어 (Directives)

Syntax: http3 on | off;
Default: http3 on;
Context: http, server

HTTP/3 프로토콜 협상을 활성화해요.

Syntax: http3_hq on | off;
Default: http3_hq off;
Context: http, server

QUIC 상호운용성(interoperability) 테스트에 사용되는 HTTP/0.9 프로토콜 협상을 활성화해요.

Syntax: http3_max_concurrent_streams number;
Default: http3_max_concurrent_streams 128;
Context: http, server

연결에서 동시 HTTP/3 요청 스트림의 최대 수를 설정해요.

Syntax: http3_stream_buffer_size size;
Default: http3_stream_buffer_size 64k;
Context: http, server

QUIC 스트림의 읽기와 쓰기에 사용되는 버퍼의 크기를 설정해요.

Syntax: quic_active_connection_id_limit number;
Default: quic_active_connection_id_limit 2;
Context: http, server

QUIC active_connection_id_limit 전송 매개변수 값을 설정해요. 이는 서버에 저장할 수 있는 클라이언트 연결 ID의 최대 수예요.

Syntax: quic_bpf on | off;
Default: quic_bpf off;
Context: main

eBPF를 사용한 QUIC 패킷 라우팅을 활성화해요. 활성화하면 QUIC 연결 마이그레이션(migration)을 지원할 수 있어요.

이 지시어는 Linux 5.7+에서만 지원돼요.

Syntax: quic_gso on | off;
Default: quic_gso off;
Context: http, server

세그멘테이션 오프로딩(segmentation offloading)을 사용하는 최적화된 배치 모드 전송을 활성화해요.

최적화된 전송은 UDP_SEGMENT를 갖춘 Linux에서만 지원돼요.

Syntax: quic_host_key file;
Default: —
Context: http, server

무상태 재설정(stateless reset)과 주소 검증 토큰을 암호화하는 데 사용되는 비밀 키가 있는 파일을 설정해요. 기본적으로 각 reload 시 무작위 키가 생성돼요. 이전 키로 생성된 토큰은 허용되지 않아요.

Syntax: quic_retry on | off;
Default: quic_retry off;
Context: http, server

QUIC 주소 검증(Address Validation) 기능을 활성화해요. 여기에는 Retry 패킷 또는 NEW_TOKEN 프레임으로 새 토큰을 보내고, Initial 패킷에서 받은 토큰을 검증하는 것이 포함돼요.

내장 변수 (Embedded Variables)

ngx_http_v3_module 모듈은 다음 내장 변수를 지원해요:

  • $http3 — 협상된 프로토콜 식별자: HTTP/3 연결의 경우 "h3", hq 연결의 경우 "hq", 그 외에는 빈 문자열.

더 알아보기 (Learn more)