openresty / openresty/lua-nginx-module

support always_forward_headers for ngx.location.capture

Open
#2,375 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.8k
Forks
2.1k
Avg merge
6h 1m
Merged PRs (30d)
6

Description

According to the documentation: Original request headers should be ignored by setting proxy_pass_request_headers to off in subrequest locations.

However, if proxy_pass_request_headers is used, the headers carried by the headers parameter will also be ignored.

I hope to use a unified location to complete the subrequest, so I hope to be able to control the headers carried to the subrequest in the Lua code (whether to forward the request headers of the main request, the request headers that have been attached, etc.), so I hope to be able to implement the always_forward_headers option, just like always_forward_body.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the ngx.location.capture API and compare the requested behavior with the existing always_forward_body option. Trace how subrequest headers and the headers parameter are handled, then define tests showing that always_forward_headers controls forwarding of the main request headers while preserving explicitly supplied headers.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, lua, nginx
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.