简体   繁体   English

AWS剥离HTTP标头?

[英]AWS Stripping HTTP Headers?

I have two AWS servers running.我有两台 AWS 服务器正在运行。 One is running a service on GO and the other other is running a PHP application.一个在 GO 上运行服务,另一个在 PHP 应用程序上运行。 When I make the call to the service via my local PHP server the results come back as expected.当我通过本地 PHP 服务器调用服务时,结果按预期返回。 When I move that same PHP code on AWS the service returns without errors but returns an empty object as if it had some of the HTTP header data stripped off by AWS. When I move that same PHP code on AWS the service returns without errors but returns an empty object as if it had some of the HTTP header data stripped off by AWS. AWS is set up to allow all inbound and outbound traffic. AWS 设置为允许所有入站和出站流量。 Any ideas?有任何想法吗?

I'm facing the same problem.我面临同样的问题。 I have a dotnet core Console App running as a service on ECS-Fargate.我有一个 dotnet 核心控制台应用程序作为 ECS-Fargate 上的服务运行。 The service tries to call a REST endpoint which requires Authorization Token.该服务尝试调用需要授权令牌的 REST 端点。 When the service calls the endpoint with an AuthToken, the response I get is 401 Unauthorized.当服务使用 AuthToken 调用端点时,我得到的响应是 401 Unauthorized。 I copy the AuthToken from CloudWatch Logs and use it in postman and it works fine;我从 CloudWatch Logs 复制 AuthToken 并在 postman 中使用它,它工作正常; I get a 200 OK.我得到一个 200 好的。 If I run the code in debug mode hardcoding the same AuthToken, the code gets a successful response as well (200 OK).如果我在调试模式下运行代码,对相同的 AuthToken 进行硬编码,代码也会获得成功的响应(200 OK)。 It seems as if the Http Header has been stripped off and AuthToken isn't sent when the REST call is made by my service on AWS.似乎 Http Header 已被剥离,并且当我的 AWS 服务调用 REST 时未发送 AuthToken 。

My setup is, a dotnet core console app (C#) running in a Docker Container hosted on aws using Fargate, running a single instance.我的设置是,一个 dotnet 核心控制台应用程序 (C#) 在 Docker 容器中运行,该容器使用 Fargate 托管在 AWS 上,运行单个实例。 Since its a console app, i'm not using any ELB.由于它是一个控制台应用程序,我没有使用任何 ELB。 Security Group allows traffic outside due to which I am getting a response back successfully.安全组允许外部流量,因此我可以成功获得响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM