diff --git a/templates/core.j2 b/templates/core.j2 index aa943ecc..a5ad984b 100644 --- a/templates/core.j2 +++ b/templates/core.j2 @@ -83,8 +83,9 @@ timer_resolution {{ main['timer_resolution'] }}; {% if main['working_directory'] is defined %} working_directory {{ main['working_directory'] }}; {% endif %} -{% if main['quic'] is defined and main['quic']['bpf'] is defined and main['quic']['bpf'] is boolean %} -quic_bpf {{ main['quic']['bpf'] | ternary('on', 'off') }}; +{% if main['quic'] is defined %} +{% from 'http/modules.j2' import quic with context %} +{{ quic(main['quic'], 'global') }} {% endif %} {% endmacro %} diff --git a/templates/http/modules.j2 b/templates/http/modules.j2 index 65cf3cd7..371c2b17 100644 --- a/templates/http/modules.j2 +++ b/templates/http/modules.j2 @@ -370,8 +370,13 @@ http3_stream_buffer_size {{ http3['stream_buffer_size'] }}; {% endmacro %} -{# NGINX QUIC -- ngix_http_v3_module #} -{% macro quic(quic) %} +{# NGINX QUIC -- ngx_event_quic #} {# exposed for use and documented through ngx_http_v3_module #} +{% macro quic(quic, scope='http') %} +{% if scope == 'global' %} +{% if quic is defined and quic['bpf'] is defined and quic['bpf'] is boolean %} +quic_bpf {{ quic['bpf'] | ternary('on', 'off') }}; +{% endif %} +{% else %} {% if quic['active_connection_id_limit'] is defined and quic['active_connection_id_limit'] is number %} quic_active_connection_id_limit {{ quic['active_connection_id_limit'] }}; {% endif %} @@ -384,5 +389,6 @@ quic_host_key {{ quic['host_key'] }}; {% if quic['retry'] is defined and quic['retry'] is boolean %} quic_retry {{ quic['retry'] | ternary('on','off') }}; {% endif %} +{% endif %} {% endmacro %}