File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 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"
110110# Default is true to not change default behavior.
111111ENV PROXY_REQUEST_BUFFERING="true"
112112
113+ # Force HTTP/1.1 upstream connections, for http2 upstream that returns 426 Upgrade Required
114+ ENV FORCE_UPSTREAM_HTTP_1_1="false"
115+
113116# Stream data; reduce TTFB
114117# Effectively disables caching
115118# 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: ---"
358358cat /etc/nginx/proxy.request.buffering.conf
359359echo -e " ---\n"
360360
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+
361375# Upstream SSL verification.
362376echo " " > /etc/nginx/docker.verify.ssl.conf
363377if [[ " 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/"
263263 # Use SNI during the TLS handshake with the upstream.
264264 proxy_ssl_server_name on;
265265
266+ # force upstream to use http 1.1
267+ include /etc/nginx/http1.1.upstream .conf;
268+
266269 # This comes from a include file generated by the entrypoint.
267270 include /etc/nginx/docker.verify.ssl .conf;
268271
You can’t perform that action at this time.
0 commit comments