Setting up proxy_pass on nginx to make API calls to API Gateway

岁酱吖の 提交于 2019-12-06 15:21:46
Louis Roché

I think you need those two lines:

proxy_set_header Host "XXXXXX.execute-api.REGION.amazonaws.com";
proxy_ssl_server_name on;

Here is the explanation about the why:

The HOST header is required as is described here

The Amazon API Gateway endpoint. This value must be one of the region-dependent endpoints listed under Regions and Endpoints. In the US East (N. Virginia) region, it is apigateway.us-east-1.amazonaws.com.

The proxy_ssl_server_name on;

Enables passing of the server name through TLS Server Name Indication extension (SNI) when establishing a connection with the proxied HTTPS server.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!