-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnginx_lambda_gateway.conf
30 lines (25 loc) · 1.01 KB
/
nginx_lambda_gateway.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
include "serverless/lambda_ngx_http.conf";
# Add the endpoint & host of Lambda server when using AWS Lambda Function URL.
# Add the endpoint, and assign the value of $lambdaFunctionARNHost when using
# AWS Lambda Function ARN.
map $request_uri $lambda_host {
# Default host name is used for AWS Lambda Function ARN
default $lambdaFunctionARNHost;
}
# Add the endpoint when using AWS Lambda Function URL. The default value is for
# the URL of AWS Lambda Function ARN.
map $request_uri $lambda_url {
default $lambdaProto://$lambda_host:$lambdaPort;
}
server {
include "serverless/lambda_ngx_apis.conf";
listen 80; # Use SSL/TLS in production
# Example of a proxy to all of the AWS Lambda Function ARNs.
location / {
auth_request /aws/credentials/retrieval;
js_content lambdagateway.redirectToLambdaFunctionARN;
}
# Enable when debugging is needed
error_log /var/log/nginx/error.log debug; # Reduce severity level as required
access_log /var/log/nginx/access.log main;
}