Comments (5)
Hi, Can you please provide the reproducing steps?
from apisix.
Hi, Can you please provide the reproducing steps?
ok
Step 1: Set up two routes and two upstreams in the dashboard. Associate route A with upstream A, and route B with upstream B. Route B is used for forwarding requests to an external authentication service (i.e., upstream B).
Step 2: Enable the forward-auth plugin for route A and set the URI to http://localhost:9080/authApi/api/authorization/authorization1 (Note: authApi is the path of route B, which means that when calling the external authentication, it should go through route B).
Step 3: Once the routes and upstreams are set up, test a POST request to the interface corresponding to upstream A through route A at http://localhost:9080/userCenterApi/api/GetToken/GetData (Note: userCenterApi is the path of route A, which means that accessing this path will make apisix forward the request).
Outcome: The external authentication service successfully validates, and during debugging, it was noticed that the request body content can be read normally. I use the following code to read the request body:
using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8))
{
body = await reader.ReadToEndAsync();
// Do something with the body...
}
After successful external validation, when the request is forwarded by route A to upstream A, upstream A is unable to read the request body. I use the following code to read the request body:
using (StreamReader reader = new StreamReader(Request.Body, Encoding.UTF8))
{
body = await reader.ReadToEndAsync();
// Do something with the body...
}
The reason for not being able to read is due to the occurrence of an exception, Microsoft.AspNetCore.Connections.ConnectionResetException, with the message: "The client has disconnected." Subsequently, the apisix log shows: "upstream timed out (110: Connection timed out) while reading response header from upstream." Once I commented out the code for reading the request body, the exception did not occur, and there was no 504 timeout.
As a beginner, I am unable to identify the root cause of this error. Your assistance in resolving this issue would be greatly appreciated. Thank you!
from apisix.
I am also running into the 504 timeout error with the following log:
*3516 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 172.21.0.1, server: _, request: "POST /anything HTTP/1.1", upstream: "http://174.129.50.9:80/anything", host: "127.0.0.1:9080"
It is unclear how to correctly use the "request_method": "POST"
option without invoking this error. I am changing very minimal config from the doc example and will be easier to reproduce.
Details:
Things run well without "request_method": "POST"
in the plugin config.
from apisix.
Related: #11050, from the convo it looks like 3.6.0 does not have this issue. To be tested.
from apisix.
Related: #11050, from the convo it looks like 3.6.0 does not have this issue. To be tested.相关: #11050 ,从 convo 来看,3.6.0 没有这个问题。待测试。
Thanks for the reply, I'll try it in version 3.6.0
from apisix.
Related Issues (20)
- help request: help request: help request: apisix 3.8.0 helm install request etcd Operation already in progress HOT 2
- bug: one of etcd server failed HOT 3
- help request: oidc plugin and opa with apisix ingress HOT 3
- bug: the plugin metadata obtained from etcd has not been validated by schema
- docs: broken links in manage api consumers page HOT 3
- feat: support DPoP in OpenID Connect/OAuth2 plugin HOT 1
- bug: not getting the authorization token in header using openid-connect plugin HOT 4
- bug: 413 Request Entity Too Large
- bug: node-status plugin doesn't work with https HOT 2
- feat: As a user, I want to make `regex-uri` able to use nginx context variables for Plugin [proxy-rewrite] HOT 1
- Support latest `gateway.networking.k8s.io/v1`
- vulnerabilities: images apisix-3.9.1-debian and apisix-dashboard:3.0.1-alpine
- help request: openid-connect different clients unexpectedly shared the same auth session HOT 6
- help request: How to export and import configuration files when switching environments HOT 1
- help request: When I was testing with forward-auth.lua, I found that enabling keepalive would cause the authentication server to fail when parsing the HTTP protocol
- help request: 如何实现跳过当前高优先级路由,继续匹配低优先级路由
- bug: apisix’s upstream code and prometheus‘s code Inconsistency
- bug: apisix prometheus metrics port not running. HOT 8
- help request: How to use Ingress CRD with host and port HOT 3
- feat: Add the possibility to manipulate query parameters / search string using proxy-rewrite plugin HOT 1
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 apisix.