title: How to setup API gateway to talk to private NLB?
body: <p>I has been using an ALB until I realized I cannot connect a private ALB to API gateway ... so am trying NLB now. </p>
  
  <p>So far I have</p>
  
  <ul>
  <li>Private NLB</li>
  <li>API Gateway VPC Link to connect to NLB</li>
  </ul>
  
  <p>But I am unsure how to configure API gateway properly. I did: </p>
  
  <ul>
  <li>Created a test route <code>GET /test</code></li>
  <li>Use VPC Link, tried proxy and non-proxy types</li>
  <li>But I am unsure of what do I put for endpoint URL. For now I did something like: <code>http://dummydomain.com/api</code> where <code>dummydomain.com</code> is a dummy domain and <code>/api</code> is my status check URL which should work</li>
  </ul>
  
  <p>Its my 1st time trying NLB. Is there anything I am missing?</p>
  
  <p>Currently when I test my API gateway function: I get HTTP500</p>
  
  <pre><code>{
    "message": "Internal server error"
  }
  </code></pre>
  
  <p>The logs: </p>
  
  <pre><code>Execution log for request 2d5e2e51-b04c-11e8-b9fe-97b354c20146
  Tue Sep 04 14:09:45 UTC 2018 : Starting execution for request: 2d5e2e51-b04c-11e8-b9fe-97b354c20146
  Tue Sep 04 14:09:45 UTC 2018 : HTTP Method: GET, Resource Path: /test
  Tue Sep 04 14:09:45 UTC 2018 : Method request path: {}
  Tue Sep 04 14:09:45 UTC 2018 : Method request query string: {}
  Tue Sep 04 14:09:45 UTC 2018 : Method request headers: {}
  Tue Sep 04 14:09:45 UTC 2018 : Method request body before transformations: 
  Tue Sep 04 14:09:45 UTC 2018 : Endpoint request URI: http://dummydomain.com/api
  Tue Sep 04 14:09:45 UTC 2018 : Endpoint request headers: {x-amzn-apigateway-api-id=4p76zcriuk, User-Agent=AmazonAPIGateway_4p76zcriuk, Host=dummydomain.com}
  Tue Sep 04 14:09:45 UTC 2018 : Endpoint request body after transformations: 
  Tue Sep 04 14:09:45 UTC 2018 : Sending request to http://dummydomain.com/api
  Tue Sep 04 14:09:56 UTC 2018 : Execution failed due to configuration error: There was an internal error while executing your request
  Tue Sep 04 14:09:56 UTC 2018 : Method completed with status: 500
  </code></pre>
  
  <hr>
  
  <p>Something I am curious about ... the target group has</p>
  
  <ul>
  <li>Protocol: TCP</li>
  <li>Port: 80</li>
  <li>Target type: IP</li>
  <li>Healthcheck passes</li>
  </ul>
  
  <p>But my app is running on port 3000. But healthchecks is passing it also correctly reflects my application is running on port 3000</p>
  
  <p><a href="https://i.stack.imgur.com/DmlA4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DmlA4.png" alt="enter image description here"></a></p>
  
  <p>But wondering if the port 80 part is a problem? Does NLB translate the port 80 traffic into port 3000? </p>