File tree 3 files changed +20
-0
lines changed
3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,9 @@ ENV ALLOW_PUSH="false"
110
110
# Default is true to not change default behavior.
111
111
ENV PROXY_REQUEST_BUFFERING="true"
112
112
113
+ # Force HTTP/1.1 upstream connections, for http2 upstream that returns 426 Upgrade Required
114
+ ENV FORCE_UPSTREAM_HTTP_1_1="false"
115
+
113
116
# Stream data; reduce TTFB
114
117
# Effectively disables caching
115
118
# Default is true to not change default behavior.
Original file line number Diff line number Diff line change @@ -358,6 +358,20 @@ echo -e "\nRequest buffering: ---"
358
358
cat /etc/nginx/proxy.request.buffering.conf
359
359
echo -e " ---\n"
360
360
361
+ # force upstream to use http 1.1
362
+ echo " " > /etc/nginx/http1.1.upstream.conf
363
+ if [[ " a${FORCE_UPSTREAM_HTTP_1_1} " == " atrue" ]]; then
364
+ cat << EOD > /etc/nginx/http1.1.upstream.conf
365
+ proxy_http_version 1.1;
366
+ proxy_set_header Upgrade \$ http_upgrade;
367
+ proxy_set_header Connection "upgrade";
368
+ EOD
369
+ fi
370
+
371
+ echo -e " \nConfigure upstream http version support: ---"
372
+ cat /etc/nginx/http1.1.upstream.conf
373
+ echo -e " ---\n"
374
+
361
375
# Upstream SSL verification.
362
376
echo " " > /etc/nginx/docker.verify.ssl.conf
363
377
if [[ " a${VERIFY_SSL} " == " atrue" ]]; then
Original file line number Diff line number Diff line change @@ -263,6 +263,9 @@ echo "Docker configured with HTTPS_PROXY=$scheme://$http_host/"
263
263
# Use SNI during the TLS handshake with the upstream.
264
264
proxy_ssl_server_name on;
265
265
266
+ # force upstream to use http 1.1
267
+ include /etc/nginx/http1.1.upstream.conf;
268
+
266
269
# This comes from a include file generated by the entrypoint.
267
270
include /etc/nginx/docker.verify.ssl.conf;
268
271
You can’t perform that action at this time.
0 commit comments