Skip to content

proc: expose forwarded headers to CGI#23

Open
Antecer wants to merge 1 commit into
openwrt:masterfrom
Antecer:expose-forwarded-cgi-headers
Open

proc: expose forwarded headers to CGI#23
Antecer wants to merge 1 commit into
openwrt:masterfrom
Antecer:expose-forwarded-cgi-headers

Conversation

@Antecer
Copy link
Copy Markdown

@Antecer Antecer commented May 10, 2026

Expose common reverse proxy headers to CGI environments.

uhttpd currently maps only a fixed set of request headers into CGI
environment variables. When LuCI or CGI applications are served behind a
reverse proxy, standard forwarding headers such as X-Forwarded-For and
X-Real-IP are not visible to backend scripts.

This prevents applications from determining the original client address
when uhttpd is behind a trusted reverse proxy. Expose the common forwarded
headers as HTTP_* CGI variables, matching the existing header whitelist
mechanism.

Added:

  • HTTP_X_FORWARDED_FOR
  • HTTP_X_FORWARDED_HOST
  • HTTP_X_FORWARDED_PORT
  • HTTP_X_FORWARDED_PROTO
  • HTTP_X_REAL_IP
  • HTTP_X_REAL_PROTO

Tested:

  • git diff --check
  • Build not run locally because cmake is not available in this environment.

Signed-off-by: Antecer <Antecer@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant