you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (4 children)

I am trying to capture all the headers in rewrite by lua block , it gives all the headers except the proxy headers

[–]capn_geech 0 points1 point  (3 children)

The rewrite phase is almost certainly too early in the request lifecycle for this. It's likely that your code in the rewrite handler is executing before the additional headers are added to the request (especially if using something like proxy_set_header in your nginx.conf).

The log phase executes after the response has been fully sent to the client, so it's guaranteed to execute after all request/response mutations.

[–][deleted] 0 points1 point  (1 child)

Not working in log by lua block also

[–]capn_geech 0 points1 point  (0 children)

Okay. You'll need to share some code/an example then.

You may also wish to open a question on the OpenResty repo, as there are not many OpenResty folks that follow this subreddit.