File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,8 +7,10 @@ server {
77 # Generated with nginx-le-setup
88 listen 80;
99 listen [::]:80;
10- listen 443 ssl${HTTP2};
11- listen [::]:443 ssl${HTTP2};
10+ listen 443 ssl http2;
11+ ${HTTP3:+listen 443 http3 reuseport;}
12+ listen [::]:443 ssl http2;
13+ ${HTTP3:+listen [::]:443 http3 reuseport;}
1214 server_name ${VDOMAINS};
1315
1416 ${CONFIG}
@@ -46,6 +48,11 @@ server {
4648 return 301 https://\$server_name\$request_uri;
4749 }
4850
51+ add_header X-protocol $server_protocol always;
52+
53+ ${HTTP3:+ add_header alt-svc 'h3=\":443\"; ma=86400';}
54+ ${HTTP3:+ quic_retry on;}
55+
4956 # HSTS (ngx_http_headers_module is required) 6 months
5057 add_header Strict-Transport-Security \"max-age=15768000; ${HSTS}\";
5158
Original file line number Diff line number Diff line change 33#
44
55NGINX_DIR=" /etc/nginx"
6- HTTP2_MIN_VERSION=1.9.5
76# Internal variables
87CONFIRM=0
98FORCE=0
109_BACKUP=0
11- HTTP2 =" "
10+ HTTP3 =" "
1211# shellcheck disable=SC2034
1312HSTS=" "
1413_CERBOT_EXTRA_ARGS=" "
@@ -49,9 +48,9 @@ _initialize_variables() {
4948
5049 _NGINX_VERSION=$( nginx -v 2>&1 | cut -d ' /' -f 2)
5150
52- if _version_gt " ${_NGINX_VERSION} " " ${HTTP2_MIN_VERSION} " ; then
51+ if (nginx -V 2>&1 | grep http_v3) ; then
5352 # shellcheck disable=SC2034
54- HTTP2= " http2 "
53+ HTTP3=1
5554 fi
5655
5756 # Check for a config file
You can’t perform that action at this time.
0 commit comments