Skip to content

fix: nginx config docs & comments #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions common/etc/nginx/conf.d/nginx_lambda_gateway.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@ include "serverless/lambda_ngx_http.conf";

map $request_uri $lambda_host {
# Use default host ($lambdaFunctionARNHost) when using one region for
# multiple Lambda Function ARNs.
# multiple Lambda Function ARNs per NGINX Lambda Gateway.
default $lambdaFunctionARNHost;

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

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

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

# Define Lambda server URL per endpoint when using AWS Lambda Function URL.
# Add Lambda server URL per endpoint when using AWS Lambda Function URL.
# '/bar' $lambdaProto://$lambda_host/;
}

Expand All @@ -31,15 +32,15 @@ server {
js_content lambdagateway.redirectToLambdaFunctionARN;
}

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

# Example of a proxy to one AWS Lambda Function URL.
# - https://{url-id}.lambda-url.{region}.on.aws/
# Add this config per endpoint when using a proxy to a Lambda Function URL.
# - https://{url-id}.lambda-url.{aws-region}.on.aws/
# location /bar {
# auth_request /aws/credentials/retrieval;
# js_content lambdagateway.redirectToLambdaFunctionURL;
Expand Down
21 changes: 11 additions & 10 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
| `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-` |

> Note:
> - Define the following environment variables in your machine if you want to use the above default values.
> - Define the following environment variables in your machine when using the above default values.
> e.g.: `AWS_REGION`, `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN` in `~/.bash_profile`.
> - `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.

Expand All @@ -51,22 +51,23 @@
```nginx
map $request_uri $lambda_host {
# Use default host ($lambdaFunctionARNHost) when using one region for
# multiple Lambda Function ARNs.
# multiple Lambda Function ARNs per NGINX Lambda Gateway.
default $lambdaFunctionARNHost;

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

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

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

# Define Lambda server URL per endpoint when using AWS Lambda Function URL.
# Add Lambda server URL per endpoint when using AWS Lambda Function URL.
# '/bar' $lambdaProto://$lambda_host/;
}

Expand All @@ -80,15 +81,15 @@
js_content lambdagateway.redirectToLambdaFunctionARN;
}

# Define this config when using a proxy to one AWS Lambda Function ARN.
# - arn:aws:lambda:{region}:{account-id}:function:foo
# Add this config per endpoint when using a proxy to a Lambda Function ARN.
# - arn:aws:lambda:{aws-region}:{account-id}:function:foo
# location /2015-03-31/functions/foo/invocations {
# auth_request /aws/credentials/retrieval;
# js_content lambdagateway.redirectToLambdaFunctionARN;
# }

# Define this config when using a proxy to one AWS Lambda Function URL.
# - https://{url-id}.lambda-url.{region}.on.aws/
# Add this config per endpoint when using a proxy to a Lambda Function URL.
# - https://{url-id}.lambda-url.{aws-region}.on.aws/
# location /bar {
# auth_request /aws/credentials/retrieval;
# js_content lambdagateway.redirectToLambdaFunctionURL;
Expand Down