title: How to fix 500 response from an NLB in a vpc when I'm trying to connect to it through vpclink (API gateway) in AWS
body: <p>I've not been able to connect to my internal VPC from API gateway through a VPC Link. In the logs, it looks like the request is going to the NLB and returning a 500 error. I can't look at the logs of the NLB because it doesn't store logs for TCP requests.</p>
  
  <p>When I'm trying to connect to my NLB from within the VPC, I'm able to do it. In my current configuration, the NLB listens in port 80 to TCP requests, and talks to the ecs fargate task through port 8080. I've followed the <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-private-integration.html" rel="nofollow noreferrer">private registry guide</a> so far.</p>
  
  <p>Configurations of API GATEWAY:
  Created an API. Created a method POST with integration type as VPC LINK and used http://{NLB dns} as the end point for my integration. I turned on vpc link proxy. I created the VPC Link</p>
  
  <p>Configurations for NLB:
  Present in private subnets of the VPC. Listens on port 80. Communicates to ecs fargate tasks through port 8080. It works when I'm hitting the same NLB through a lambda function which is in the VPC.</p>
  
  <p>Expected result: Request is sent to ecs fargate task.
  CUrrent result/response: 500 error from NLB. Request doesn't even reach ecs fargate task</p>