in_nginx_exporter_metrics: enable scraping of TLS endpoints.
@@ -1505,6 +1505,7 @@ struct nginx_ctx *nginx_ctx_init(struct flb_input_instance *ins,
struct flb_config *config)
{
int ret;
+ int upstream_flags;
struct nginx_ctx *ctx;
struct flb_upstream *upstream;
@@ -1538,8 +1539,15 @@ struct nginx_ctx *nginx_ctx_init(struct flb_input_instance *ins,
return NULL;
}
+ upstream_flags = FLB_IO_TCP;
+
+ if (ins->use_tls) {
+ upstream_flags |= FLB_IO_TLS;
+ }
+
upstream = flb_upstream_create(config, ins->host.name, ins->host.port,
- FLB_IO_TCP, NULL);
+ upstream_flags, ins->tls);
+
if (!upstream) {
flb_plg_error(ins, "upstream initialization error");
return NULL;
