openresty / openresty/lua-nginx-module

ngx.exec() can not pass the data of post quest body to the upstream server

Open
#1,652 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

Hello, This is a problem i meet, That is the ngx.exec() can not pass the data of post quest body to the upstream server.
below is my code in content_by_lua*:

local method = ngx.req.get_method()
if method == 'POST' then
local ct = ngx.var.content_type
if string.find(ct, "multipart/form-data;", 1 ,true) ~= nil then
-- '@client' is a named locations in nginx confg
return ngx.exec('@client')
end
end

the upstream server can get the post request, and the http header is correct,but this is no body data, so what can i do to resovle the problem?? sorry to my English...

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 with the content_by_lua* snippet and the ngx.exec('@client') entry point, then inspect the related nginx configuration and upstream request handling. Reproduce the multipart/form-data POST and compare the headers and body received upstream; done means the missing-body behavior is explained and a verified resolution or documented limitation is established.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, nginx
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.