Giter Site home page Giter Site logo

Comments (5)

lynch1981 avatar lynch1981 commented on July 4, 2024 1
  1. you can use wireshark to capture the packets, but the backend uses http protocol, not https
  2. 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.

lynch1981 avatar lynch1981 commented on July 4, 2024

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.

shengbinxu avatar shengbinxu commented on July 4, 2024

@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

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.

lynch1981 avatar lynch1981 commented on July 4, 2024

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.

shengbinxu avatar shengbinxu commented on July 4, 2024

Okay, I understand a bit.

I understand the mechanism you described. And:

  1. What is the way to dump the request information of subrequest?
  2. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.