Get Source IP in API Gateway¶
client ip¶
-
create function nodejs 18x
-
create rest api
- create
POST
method and integration request to lambda -
in
method execution
, addmapping templates
, content-type isapplication/json
, content as following:
-
deploy it and test
- curl
alb ip¶
- 如果 alb 在 api gateway 前端,将获取到 alb 的内网地址,如下场景: