Skip to content

Commit 7bd2b6f

Browse files
authored
Merge pull request #36 from nginx-serverless/ngx-lambda
fix: nginx config docs & comments
2 parents 76e6c9d + 768f9a5 commit 7bd2b6f

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

common/etc/nginx/conf.d/nginx_lambda_gateway.conf

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@ include "serverless/lambda_ngx_http.conf";
22

33
map $request_uri $lambda_host {
44
# Use default host ($lambdaFunctionARNHost) when using one region for
5-
# multiple Lambda Function ARNs.
5+
# multiple Lambda Function ARNs per NGINX Lambda Gateway.
66
default $lambdaFunctionARNHost;
77

8-
# Define $lambdaFunctionARNHost per endpoint when using multiple regions
8+
# Add default host per endpoint when using multiple regions for
99
# multiple Lambda Function ARNs per NGINX Lambda Gateway.
1010
# '/2015-03-31/functions/foo/invocations' $lambdaFunctionARNHost;
1111

12-
# Define the following host per endpoint when using AWS Lambda Function URL.
13-
# '/bar' {url-id}.lambda-url.{region}.on.aws;
12+
# Add the following host with ediging {url_id} and {aws-region} per endpoint
13+
# when using AWS Lambda Function URL
14+
# '/bar' {url-id}.lambda-url.{aws-region}.on.aws;
1415
}
1516

1617
map $request_uri $lambda_url {
1718
# Use default Lambda server URL when using AWS Lambda Function ARN.
1819
default $lambdaProto://$lambda_host:$lambdaPort;
1920

20-
# Define Lambda server URL per endpoint when using AWS Lambda Function URL.
21+
# Add Lambda server URL per endpoint when using AWS Lambda Function URL.
2122
# '/bar' $lambdaProto://$lambda_host/;
2223
}
2324

@@ -31,15 +32,15 @@ server {
3132
js_content lambdagateway.redirectToLambdaFunctionARN;
3233
}
3334

34-
# Example of a proxy to one AWS Lambda Function ARN.
35-
# - arn:aws:lambda:{region}:{account-id}:function:foo
35+
# Add this config per endpoint when using a proxy to a Lambda Function ARN.
36+
# - arn:aws:lambda:{aws-region}:{account-id}:function:foo
3637
# location /2015-03-31/functions/foo/invocations {
3738
# auth_request /aws/credentials/retrieval;
3839
# js_content lambdagateway.redirectToLambdaFunctionARN;
3940
# }
4041

41-
# Example of a proxy to one AWS Lambda Function URL.
42-
# - https://{url-id}.lambda-url.{region}.on.aws/
42+
# Add this config per endpoint when using a proxy to a Lambda Function URL.
43+
# - https://{url-id}.lambda-url.{aws-region}.on.aws/
4344
# location /bar {
4445
# auth_request /aws/credentials/retrieval;
4546
# js_content lambdagateway.redirectToLambdaFunctionURL;

docs/getting_started.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
| `HEADER_PREFIXES_TO_STRIP` | No | `true`, `false` | `false` | A list of HTTP header prefixes that exclude headers client responses. List should be specified in lower-case and a semicolon (;) should be used to as a deliminator between values. For example: `x-amz-;x-something-` |
4141

4242
> Note:
43-
> - Define the following environment variables in your machine if you want to use the above default values.
43+
> - Define the following environment variables in your machine when using the above default values.
4444
> e.g.: `AWS_REGION`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` in `~/.bash_profile`.
4545
> - `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` are only used to configure the gateway when running as a Container or as a Systemd service.
4646
@@ -51,22 +51,23 @@
5151
```nginx
5252
map $request_uri $lambda_host {
5353
# Use default host ($lambdaFunctionARNHost) when using one region for
54-
# multiple Lambda Function ARNs.
54+
# multiple Lambda Function ARNs per NGINX Lambda Gateway.
5555
default $lambdaFunctionARNHost;
5656
57-
# Define $lambdaFunctionARNHost per endpoint when using multiple regions
57+
# Add default host per endpoint when using multiple regions for
5858
# multiple Lambda Function ARNs per NGINX Lambda Gateway.
5959
# '/2015-03-31/functions/foo/invocations' $lambdaFunctionARNHost;
6060
61-
# Define the following host per endpoint when using AWS Lambda Function URL
62-
# '/bar' {url-id}.lambda-url.{region}.on.aws;
61+
# Add the following host with ediging {url_id} and {aws-region} per endpoint
62+
# when using AWS Lambda Function URL
63+
# '/bar' {url-id}.lambda-url.{aws-region}.on.aws;
6364
}
6465
6566
map $request_uri $lambda_url {
6667
# Use default Lambda server URL when using AWS Lambda Function ARN.
6768
default $lambdaProto://$lambda_host:$lambdaPort;
6869
69-
# Define Lambda server URL per endpoint when using AWS Lambda Function URL.
70+
# Add Lambda server URL per endpoint when using AWS Lambda Function URL.
7071
# '/bar' $lambdaProto://$lambda_host/;
7172
}
7273
@@ -80,15 +81,15 @@
8081
js_content lambdagateway.redirectToLambdaFunctionARN;
8182
}
8283
83-
# Define this config when using a proxy to one AWS Lambda Function ARN.
84-
# - arn:aws:lambda:{region}:{account-id}:function:foo
84+
# Add this config per endpoint when using a proxy to a Lambda Function ARN.
85+
# - arn:aws:lambda:{aws-region}:{account-id}:function:foo
8586
# location /2015-03-31/functions/foo/invocations {
8687
# auth_request /aws/credentials/retrieval;
8788
# js_content lambdagateway.redirectToLambdaFunctionARN;
8889
# }
8990
90-
# Define this config when using a proxy to one AWS Lambda Function URL.
91-
# - https://{url-id}.lambda-url.{region}.on.aws/
91+
# Add this config per endpoint when using a proxy to a Lambda Function URL.
92+
# - https://{url-id}.lambda-url.{aws-region}.on.aws/
9293
# location /bar {
9394
# auth_request /aws/credentials/retrieval;
9495
# js_content lambdagateway.redirectToLambdaFunctionURL;

0 commit comments

Comments
 (0)