Comments (5)
- you can use wireshark to capture the packets, but the backend uses http protocol, not https
- No, you told the backend server that there will be a three-byte request body, so the backend server can only wait
from lua-nginx-module.
body is allowed to be nil.
I tried to reproduce this issue, but there is no difference between empty string and nil.
can you attach the output of curl?
curl -s http://127.0.0.1:8005/
from lua-nginx-module.
@lynch1981
Thank you for your reply.
There was an omission in my previous description of the problem. Only when a post request is used and the post body is not empty, will the exception be triggered.
curl -s 'http://127.0.0.1:8005' -d 'xxx'
![image](https://private-user-images.githubusercontent.com/3232275/275215059-84cadeae-127b-480d-b2d1-e5b43ae2d1a4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTA4Mzk0MjIsIm5iZiI6MTcxMDgzOTEyMiwicGF0aCI6Ii8zMjMyMjc1LzI3NTIxNTA1OS04NGNhZGVhZS0xMjdiLTQ4MGQtYjJkMS1lNWI0M2FlMmQxYTQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDMxOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAzMTlUMDkwNTIyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDZkM2JkNjFiNzNhMDkyMWIzZmYzZmY5NzQxZTc2NGQ5NjU0MDNlZDI2ZmIyNDRmODdmNzljYTJmZWI4ZjU4NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Vy4N79PS63tPuEZyCE2A3SxmLD2kHlWrRuHRDARIwp0)
nginx error log:
2023/10/14 20:45:21 [warn] 8688#0: *1336 upstream server temporarily disabled while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "POST / HTTP/1.1", subrequest: "/backend", upstream: "https://153.3.238.110:443/backend", host: "127.0.0.1:8005"
2023/10/14 20:45:21 [error] 8688#0: *1336 upstream timed out (60: Operation timed out) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "POST / HTTP/1.1", subrequest: "/backend", upstream: "https://153.3.238.110:443/backend", host: "127.0.0.1:8005"
2023/10/14 20:45:21 [info] 8688#0: *1336 kevent() reported that client 127.0.0.1 closed keepalive connection
from lua-nginx-module.
When you call ngx.location.capture_multi you set body to nil, which means no request body is required when initializing the subrequest. Therefore, the request body carried by curl -d "xxx" will not be passed to the backend. But when you set the -d parameter, the request header will contain "Content-Length: 3", which requires the backend server to receive the request body, and the server waits until it times out.
from lua-nginx-module.
Okay, I understand a bit.
I understand the mechanism you described. And:
- What is the way to dump the request information of subrequest?
- Besides this mechanism of "the server waits until it times out", can it immediately fail and report an error to the user?
from lua-nginx-module.
Related Issues (20)
- failed build with clang HOT 2
- HTTP/2 with location.capture() re-enable HOT 1
- worker process 29320 exited on signal 11 HOT 1
- [feature request] ngx.req.get_body_data() return first n bytes
- why not support lua phase in pre_content phase HOT 1
- [bug]attempt to index global 'sw_tracer ' (a nil value) HOT 3
- Is the nginx 1.24.0 supported? HOT 2
- feature: string buffer support in sock:send()
- ngx_http_lua_module with support of pcre2 HOT 13
- Why can't I use ngx.redirect or ngx.say in the header_filter_by_lua phase HOT 1
- [Introducing a testing framework similar to test::nginx] burl: A simple but flexible HTTP/3 testing framework based on bash and curl
- Why is global environment of each lua handler not isolated when OpenResty's LuaJIT is used?
- Lua code in header_filter phase still runs after ngx.exit(401) is executed in access phase HOT 3
- Shared dictionary cannot retrieve stale data HOT 1
- Content-Length header ignored for HEAD methods HOT 1
- In order to set the headers of the upstream request, I use `ngx.req.set_header` in `rewrite_by_lua_block`, but my upstream endpoint cannot receive such header. HOT 5
- How to share ctx in dfferent locations HOT 2
- http2 request failed HOT 3
- Is the dynamic module available precompiled? HOT 1
- Problem with post request reading in balancer_by_lua_block HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lua-nginx-module.