Welcome! Log In Create A New Profile

Advanced

Creating custom module to pass trailers

April 23, 2024 07:14PM
Hi folks,

I'm trying to create a dynamic module that sets `pass_trailers` of the upstream object to 1. I'm having trouble getting a reference to the `ngx_http_upstream_s` object in our module as we'll need it to get that `conf` and set "pass_trailers = 1" there.

This is what our custom module is looking like now:
----------
static char *ngx_http_pass_trailers(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
ngx_http_upstream_srv_conf_t *uscf;
uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
// uscf->srv_conf[0]->pass_trailers = 1; // This is incorrect, but we want to somehow set pass_trailers of the upstream conf to 1 here

return NGX_CONF_OK;
} /* ngx_http_pass_trailers *
----------

Could we get some guidance on how to set pass_trailers of the upstream object from uscf? Or if we should be getting the upstream object a different way?
Subject Author Posted

Creating custom module to pass trailers

tas7al April 23, 2024 07:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 184
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready