Welcome! Log In Create A New Profile

Advanced

module context.

August 18, 2020 03:12AM
Hi,
I have a module. I am saving some data in my module context. However, in
certain cases, I am doing an internal redirect. When I do an internal
redirect my context is cleared as per the nginx development guide. Is there
a way to save the context data. Since this data is specific to the request,
I want to save it in the ngx_http_request_t if possible.

My current solution is to save it as header values and retrieve them later
after the internal redirect has happened. I am setting a special header to
say, I've saved data. This is not an elegant solution but it works. The
problem is, since I am saving it in headers, the header I added to save my
context data is being sent to the origin as a header. After restoring my
context, I tried setting the header key and value lengths to zero and also
tried setting header hash to zero. None of these things seem to help and
the header is still getting transmitted.

Two questions: Is there a way to save module context data in
ngx_http_request_t when an internal redirect happens? If not, is there a
way to prevent the custom headers add by module from going out? Thanks for
help.

Dk.
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

module context.

dnj0496 520 August 18, 2020 03:12AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 293
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready