File tree 6 files changed +62
-4
lines changed
6 files changed +62
-4
lines changed Original file line number Diff line number Diff line change 36
36
- ' linux/arm/v6'
37
37
refs :
38
38
- ' master'
39
- - ' 0.40 '
39
+ - ' 0.41 '
40
40
steps :
41
41
42
42
# ------------------------------------------------------------
@@ -128,7 +128,7 @@ jobs:
128
128
- ' Nginx stable'
129
129
refs :
130
130
- ' master'
131
- - ' 0.40 '
131
+ - ' 0.41 '
132
132
steps :
133
133
134
134
# ------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ This Docker container adds a lot of injectables in order to customize it to your
142
142
| PHP_FPM_SERVER_ADDR | string | `` | IP address or hostname of remote PHP-FPM server.<br /><strong >Required when enabling PHP.</strong > |
143
143
| PHP_FPM_SERVER_PORT | int | ` 9000 ` | Port of remote PHP-FPM server |
144
144
| PHP_FPM_TIMEOUT | int | ` 180 ` | Timeout in seconds to upstream PHP-FPM server |
145
+ | HTTP2_ENABLE | int | ` 1 ` | Enabled or disabled HTTP2 support.<br />Values:<br />` 0 ` : Disabled<br />` 1 ` : Enabled<br />Defaults to Enabled |
145
146
146
147
##### Optional environmental variables (default vhost)
147
148
Original file line number Diff line number Diff line change @@ -9,6 +9,35 @@ set -o pipefail
9
9
# Functions
10
10
# ###########################################################
11
11
12
+
13
+ # ##
14
+ # ## Ensure HTTP2_ENABLE is exported
15
+ # ##
16
+ export_http2_enable () {
17
+ local varname=" ${1} "
18
+ local debug=" ${2} "
19
+ local value=" 1"
20
+
21
+ if ! env_set " ${varname} " ; then
22
+ log " info" " \$ ${varname} not set. Enabling http2." " ${debug} "
23
+ else
24
+ value=" $( env_get " ${varname} " ) "
25
+ if [ " ${value} " = " 0" ]; then
26
+ log " info" " http2: Disabled" " ${debug} "
27
+ elif [ " ${value} " = " 1" ]; then
28
+ log " info" " http2: Enabled" " ${debug} "
29
+ else
30
+ log " err" " Invalid value for \$ ${varname} : ${value} "
31
+ log " err" " Must be '1' (for On) or '0' (for Off)"
32
+ exit 1
33
+ fi
34
+ fi
35
+
36
+ # Ensure variable is exported
37
+ eval " export ${varname} =${value} "
38
+ }
39
+
40
+
12
41
# ##
13
42
# ## Copy custom vhost-gen template
14
43
# ##
@@ -147,3 +176,19 @@ vhost_gen_mass_vhost_tld() {
147
176
run " sed -i'' 's/__TLD__/${tld} /g' ${config} " " ${debug} "
148
177
fi
149
178
}
179
+
180
+
181
+ # ##
182
+ # ## Set HTTP2_ENABLE
183
+ # ##
184
+ vhost_gen_http2 () {
185
+ local enable=" ${1} "
186
+ local config=" ${2} "
187
+ local debug=" ${3} "
188
+
189
+ if [ " ${enable} " -eq " 1" ]; then
190
+ run " sed -i'' 's/__HTTP2_ENABLE__/True/g' ${config} " " ${debug} "
191
+ else
192
+ run " sed -i'' 's/__HTTP2_ENABLE__/False/g' ${config} " " ${debug} "
193
+ fi
194
+ }
Original file line number Diff line number Diff line change @@ -92,6 +92,11 @@ export_php_fpm_server_addr "PHP_FPM_SERVER_ADDR" "${DEBUG_LEVEL}"
92
92
export_php_fpm_server_port " PHP_FPM_SERVER_PORT" " ${DEBUG_LEVEL} "
93
93
export_php_fpm_timeout " PHP_FPM_TIMEOUT" " ${DEBUG_LEVEL} "
94
94
95
+ # ##
96
+ # ## Ensure global main/mass variables are eported
97
+ # ##
98
+ export_http2_enable " HTTP2_ENABLE" " ${DEBUG_LEVEL} "
99
+
95
100
96
101
# ##
97
102
# ## Ensure MAIN_VHOST variables are exported
@@ -151,6 +156,13 @@ vhost_gen_docker_logs "${DOCKER_LOGS}" "/etc/vhost-gen/main.yml" "${DEBUG_LEVEL}
151
156
vhost_gen_docker_logs " ${DOCKER_LOGS} " " /etc/vhost-gen/mass.yml" " ${DEBUG_LEVEL} "
152
157
153
158
159
+ # ##
160
+ # ## Set HTTP2 support
161
+ # ##
162
+ vhost_gen_http2 " ${HTTP2_ENABLE} " " /etc/vhost-gen/main.yml" " ${DEBUG_LEVEL} "
163
+ vhost_gen_http2 " ${HTTP2_ENABLE} " " /etc/vhost-gen/mass.yml" " ${DEBUG_LEVEL} "
164
+
165
+
154
166
# ##
155
167
# ## Main vhost settings
156
168
# ##
Original file line number Diff line number Diff line change 94
94
- index.htm
95
95
# SSL Definition
96
96
ssl :
97
- http2 : True
97
+ http2 : __HTTP2_ENABLE__
98
98
dir_crt : /etc/httpd/cert/main
99
99
dir_key : /etc/httpd/cert/main
100
100
protocols : ' TLSv1 TLSv1.1 TLSv1.2'
Original file line number Diff line number Diff line change 94
94
- index.htm
95
95
# SSL Definition
96
96
ssl :
97
- http2 : True
97
+ http2 : __HTTP2_ENABLE__
98
98
dir_crt : /etc/httpd/cert/mass
99
99
dir_key : /etc/httpd/cert/mass
100
100
protocols : ' TLSv1 TLSv1.1 TLSv1.2'
You can’t perform that action at this time.
0 commit comments