File tree Expand file tree Collapse file tree 5 files changed +39
-1
lines changed Expand file tree Collapse file tree 5 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ This is useful when testing or for development instances or when a load-balancer
100100* ` SSL_SESSION_TIMEOUT ` - Specifies a time during which a client may reuse the session parameters (defaults to 10min)
101101* ` HTTP_LISTEN_PORT ` - Change the default inside the container from 10080.
102102* ` HTTPS_LISTEN_PORT ` - Change the default inside the container from 10443.
103+ * ` HTTP2 ` - Defaults to false ` FALSE ` . Specifies whether http2 should be used
103104* ` HTTPS_REDIRECT ` - Toggle whether or not we force redirects to HTTPS. Defaults to true.
104105* ` ALLOW_COUNTRY_CSV ` - List of [ country codes] ( http://dev.maxmind.com/geoip/legacy/codes/iso3166/ ) to allow.
105106* ` STATSD_METRICS ` - Toggle if metrics are logged to statsd (defaults to true)
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ pushd openresty
8787 --add-module=" ../naxsi/naxsi_src" \
8888 --add-module=" ../nginx-statsd" \
8989 --with-http_realip_module \
90+ --with-http_v2_module \
9091 --with-http_stub_status_module
9192make install
9293popd
Original file line number Diff line number Diff line change @@ -604,6 +604,34 @@ else
604604 echo " Testing VERBOSE_ERROR_PAGES works..."
605605fi
606606
607+ start_test " Test to ensure HTTP/2 is enabled when HTTP2 is set to true" " ${STD_CMD} \
608+ -e \" PROXY_SERVICE_HOST=http://${MOCKSERVER} \" \
609+ -e \" PROXY_SERVICE_PORT=${MOCKSERVER_PORT} \" \
610+ -e \" DNSMASK=TRUE\" \
611+ -e \" ENABLE_UUID_PARAM=FALSE\" \
612+ -e \" HTTP2=TRUE\" \
613+ --link \" ${MOCKSERVER} :${MOCKSERVER} \" "
614+ if curl -kv https://${DOCKER_HOST_NAME} :${PORT} / 2>&1 | grep ' HTTP/2 200' ; then
615+ echo " Testing HTTP2 Works"
616+ else
617+ echo " HTTP2 didnt work"
618+ exit 1
619+ fi
620+
621+ start_test " Test to ensure HTTP/2 is disabled when HTTP2 is set to false" " ${STD_CMD} \
622+ -e \" PROXY_SERVICE_HOST=http://${MOCKSERVER} \" \
623+ -e \" PROXY_SERVICE_PORT=${MOCKSERVER_PORT} \" \
624+ -e \" DNSMASK=TRUE\" \
625+ -e \" ENABLE_UUID_PARAM=FALSE\" \
626+ -e \" HTTP2=FALSE\" \
627+ --link \" ${MOCKSERVER} :${MOCKSERVER} \" "
628+ if ! curl -kv https://${DOCKER_HOST_NAME} :${PORT} / 2>&1 | grep ' HTTP/2 200' ; then
629+ echo " Testing HTTP2 FALSE Flag Works"
630+ else
631+ echo " HTTP2 FALSE didnt work"
632+ exit 1
633+ fi
634+
607635echo " _________________________________"
608636echo " We got here, ALL tests successful"
609637clean_up
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ export SSL_PROTOCOLS=${SSL_PROTOCOLS:-'TLSv1.2'}
1111export SSL_SESSION_TIMEOUT=${SSL_SESSION_TIMEOUT:- ' 10m' }
1212export HTTP_LISTEN_PORT=${HTTP_LISTEN_PORT:- 10080}
1313export HTTPS_LISTEN_PORT=${HTTPS_LISTEN_PORT:- 10443}
14+ export HTTP2=${HTTP2:- ' FALSE' }
1415export HTTPS_REDIRECT=${HTTPS_REDIRECT:- ' TRUE' }
1516export NO_LOGGING_BODY=${NO_LOGGING_BODY:- ' TRUE' }
1617export NO_LOGGING_RESPONSE=${NO_LOGGING_RESPONSE:- ' TRUE' }
Original file line number Diff line number Diff line change @@ -6,6 +6,13 @@ export LOG_UUID=FALSE
66
77. /defaults.sh
88
9+ if [ " $HTTP2 " = " TRUE" ]; then
10+ HTTP2=" http2"
11+ else
12+ HTTP2=" "
13+ fi
14+
15+
916cat > ${NGIX_CONF_DIR} /server_certs.conf << -EOF_CERT_CONF
1017 ssl_certificate ${SERVER_CERT} ;
1118 ssl_certificate_key ${SERVER_KEY} ;
5158 export REMOTE_IP_VAR=" remote_addr"
5259 cat >> ${NGIX_LISTEN_CONF} << -EOF-LISTEN-NONPP
5360 listen ${HTTP_LISTEN_PORT} ;
54- listen ${HTTPS_LISTEN_PORT} ssl;
61+ listen ${HTTPS_LISTEN_PORT} ssl ${HTTP2} ;
5562 set \$ real_client_ip_if_set '';
5663 EOF-LISTEN-NONPP
5764fi
You can’t perform that action at this time.
0 commit comments