initial commit
This commit is contained in:
13
angie/snip/http-alt-svc.j2
Normal file
13
angie/snip/http-alt-svc.j2
Normal file
@@ -0,0 +1,13 @@
|
||||
## sourced by autoconf/http-alt-svc.conf
|
||||
{#- prologue -#}
|
||||
{%- set extra_proto = ['v3', 'v2'] -%}
|
||||
{%- set confload = ( env.NGX_HTTP_CONFLOAD or '' ) | str_split_to_list -%}
|
||||
{%- set proto = confload | list_intersect(extra_proto) -%}
|
||||
{#- ALPN mapping -#}
|
||||
## TODO: make this configurable
|
||||
{%- set proto = proto | re_sub('^v2$', 'h2=":443"; ma=3600') -%}
|
||||
{%- set proto = proto | re_sub('^v3$', 'h3=":443"; ma=3600') -%}
|
||||
{#- main part -#}
|
||||
{%- if proto %}
|
||||
add_header Alt-Svc {{ (proto | join(', ')) | ngx_esc }};
|
||||
{%- endif %}
|
Reference in New Issue
Block a user