adjusted when they are parsed, this setting must appear in the global
section before the proxies, which is normally the case.
- See also: "option disable-h2-upgrade", "alpn", "no-alpn", "proto"
+ See also: "option disable-h2-upgrade", "alpn", "no-alpn", "proto", and the
+ "h2_enabled" sample fetch.
tune.h2.fe.glitches-threshold <number>
Sets the threshold for the number of glitches on a frontend connection, where
fe_conn([<frontend>]) integer
fe_req_rate([<frontend>]) integer
fe_sess_rate([<frontend>]) integer
+h2_enabled boolean
hostname string
int(<integer>) signed
ipv4(<ipv4>) ipv4
tcp-request content accept if ! too_fast
tcp-request content accept if WAIT_END
+h2_enabled : boolean
+ Returns true when the support for HTTP/2 was compiled and if HTTP/2 is not
+ disabled on frontends by the "tune.h2.fe.enabled" global option. This may be
+ used to adapt some rules depending on whether HTTP/2 may be served to
+ clients or not, such as filtering, headers, thresholds or redirects. See also
+ the "tune.h2.fe.enabled" global option.
+
hostname : string
Returns the system hostname.
}
+/* Check if HTTP/2 support was compiled and was not disabled on frontends by
+ * the "tune.h2.fe.enabled" global option.
+ */
+static int smp_fetch_h2_enabled(const struct arg *args, struct sample *smp, const char *kw, void *private)
+{
+ smp->data.type = SMP_T_BOOL;
+ smp->flags = 0;
+#ifdef USE_H2
+ smp->data.u.sint = !(global.tune.options2 & GTUNE2_DISABLE_H2_FE);
+#else
+ smp->data.u.sint = 0;
+#endif
+ return 1;
+}
+
/* Check if QUIC support was compiled and was not disabled by "tune.quic.listen" global option */
static int smp_fetch_quic_enabled(const struct arg *args, struct sample *smp, const char *kw, void *private)
{
{ "env", smp_fetch_env, ARG1(1,STR), NULL, SMP_T_STR, SMP_USE_CONST },
{ "date", smp_fetch_date, ARG2(0,SINT,STR), smp_check_date_unit, SMP_T_SINT, SMP_USE_CONST },
{ "date_us", smp_fetch_date_us, 0, NULL, SMP_T_SINT, SMP_USE_CONST },
+ { "h2_enabled", smp_fetch_h2_enabled, 0, NULL, SMP_T_BOOL, SMP_USE_CONST },
{ "hostname", smp_fetch_hostname, 0, NULL, SMP_T_STR, SMP_USE_CONST },
{ "master_id", smp_fetch_master_id, 0, NULL, SMP_T_STR, SMP_USE_CONST },
{ "nbproc", smp_fetch_nbproc,0, NULL, SMP_T_SINT, SMP_USE_CONST },