File tree 13 files changed +35
-30
lines changed
01-all-lambda-function-arns
02-one-lambda-function-arn
03-one-lambda-function-url
04-lambda-function-arn-and-url
13 files changed +35
-30
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,13 @@ location /aws/credentials/retrieval {
7
7
}
8
8
9
9
location @lambda_function_arn {
10
- include "lambda /lambda_ngx_proxy.conf";
10
+ include "aws /lambda_ngx_proxy.conf";
11
11
proxy_set_header Authorization $lambdaFunctionARNAuth;
12
12
proxy_pass $lambda_url$lambdaURI;
13
13
}
14
14
15
15
location @lambda_function_url {
16
- include "lambda /lambda_ngx_proxy.conf";
16
+ include "aws /lambda_ngx_proxy.conf";
17
17
proxy_set_header Authorization $lambdaFunctionURLAuth;
18
18
proxy_pass $lambda_url;
19
19
}
Original file line number Diff line number Diff line change 1
- js_import /etc/nginx/lambda /awscredentials.js;
2
- js_import /etc/nginx/lambda /awssig4.js;
3
- js_import /etc/nginx/lambda /lambdagateway.js;
1
+ js_import /etc/nginx/aws /awscredentials.js;
2
+ js_import /etc/nginx/aws /awssig4.js;
3
+ js_import /etc/nginx/aws /lambdagateway.js;
4
4
5
5
# This header is needed when doing v4 signature authentication. It
6
6
# specifies the timestamp in which the signature was generated and is used with
@@ -29,9 +29,14 @@ map $request_uri $uri_path {
29
29
# Add the endpoint, and assign the value of $lambdaFunctionARNHost when using
30
30
# AWS Lambda Function ARN.
31
31
map $request_uri $lambda_host {
32
- default $lambdaFunctionARNHost;
33
- '/bar' 'it6io4wr54p5ngkzygs4okvdmq0keqhf.lambda-url.us-east-2.on.aws';
32
+ # Default host name is used for AWS Lambda Function ARN
33
+ default $lambdaFunctionARNHost;
34
+
35
+ # Define host per an API endpoint for AWS Lambda Function ARN
34
36
'/2015-03-31/functions/foo/invocations' $lambdaFunctionARNHost;
37
+
38
+ # Define host per an API endpoint for AWS Lambda Function URL
39
+ '/bar' it6io4wr54p5ngkzygs4okvdmq0keqhf.lambda-url.us-east-2.on.aws;
35
40
}
36
41
37
42
# Add the endpoint when using AWS Lambda Function URL. The default value is for
Original file line number Diff line number Diff line change @@ -3,14 +3,14 @@ FROM nginx
3
3
LABEL maintainer="Shawn"
4
4
5
5
RUN mkdir -p /etc/nginx/conf.d \
6
- mkdir -p /etc/nginx/lambda && \
6
+ mkdir -p /etc/nginx/aws && \
7
7
mkdir -p /etc/nginx/status
8
8
9
9
RUN chmod -R 644 /etc/nginx
10
10
RUN chmod -R 644 /etc/nginx/conf.d
11
- RUN chmod -R 644 /etc/nginx/lambda
11
+ RUN chmod -R 644 /etc/nginx/aws
12
12
13
- COPY core/* /etc/nginx/lambda /
13
+ COPY core/* /etc/nginx/aws /
14
14
COPY common/etc/nginx/nginx.conf /etc/nginx/
15
15
16
16
STOPSIGNAL SIGTERM
Original file line number Diff line number Diff line change @@ -73,16 +73,16 @@ RUN set -x \
73
73
&& ln -sf /dev/stderr /var/log/nginx/error.log
74
74
75
75
RUN mkdir -p /etc/nginx/conf.d \
76
- mkdir -p /etc/nginx/lambda && \
76
+ mkdir -p /etc/nginx/aws && \
77
77
mkdir -p /etc/nginx/status
78
78
79
79
VOLUME /etc/nginx
80
80
81
81
RUN chmod -R 644 /etc/nginx
82
82
RUN chmod -R 644 /etc/nginx/conf.d
83
- RUN chmod -R 644 /etc/nginx/lambda
83
+ RUN chmod -R 644 /etc/nginx/aws
84
84
85
- COPY core/* /etc/nginx/lambda /
85
+ COPY core/* /etc/nginx/aws /
86
86
COPY common/etc/nginx/nginx.conf /etc/nginx/
87
87
88
88
EXPOSE 80
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ services:
13
13
# dockerfile: ./docker/Dockerfile.plus
14
14
volumes :
15
15
- ../../examples/01-all-lambda-function-arns/:/etc/nginx/conf.d/
16
- - ../../core:/etc/nginx/lambda
16
+ - ../../core:/etc/nginx/aws
17
17
ports :
18
18
- " 80:80"
19
19
env_file :
Original file line number Diff line number Diff line change 1
- include "lambda /lambda_ngx_http.conf";
1
+ include "aws /lambda_ngx_http.conf";
2
2
3
3
server {
4
- include "lambda /lambda_ngx_apis.conf";
5
- listen 80;
4
+ include "aws /lambda_ngx_apis.conf";
5
+ listen 80; # Use SSL/TLS in production
6
6
7
7
# Example of a proxy to all of the AWS Lambda Function ARNs.
8
8
location / {
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ services:
13
13
# dockerfile: ./docker/Dockerfile.plus
14
14
volumes :
15
15
- ../../examples/02-one-lambda-function-arn/:/etc/nginx/conf.d/
16
- - ../../core:/etc/nginx/lambda
16
+ - ../../core:/etc/nginx/aws
17
17
ports :
18
18
- " 80:80"
19
19
env_file :
Original file line number Diff line number Diff line change 1
- include "lambda /lambda_ngx_http.conf";
1
+ include "aws /lambda_ngx_http.conf";
2
2
3
3
server {
4
- include "lambda /lambda_ngx_apis.conf";
5
- listen 80;
4
+ include "aws /lambda_ngx_apis.conf";
5
+ listen 80; # Use SSL/TLS in production
6
6
7
7
# Example of a proxy to one AWS Lambda Function ARN.
8
8
location /2015-03-31/functions/foo/invocations {
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ services:
13
13
# dockerfile: ./docker/Dockerfile.plus
14
14
volumes :
15
15
- ../../examples/03-one-lambda-function-url/:/etc/nginx/conf.d/
16
- - ../../core:/etc/nginx/lambda
16
+ - ../../core:/etc/nginx/aws
17
17
ports :
18
18
- " 80:80"
19
19
env_file :
Original file line number Diff line number Diff line change 1
- include "lambda /lambda_ngx_http.conf";
1
+ include "aws /lambda_ngx_http.conf";
2
2
3
3
server {
4
- include "lambda /lambda_ngx_apis.conf";
5
- listen 80;
4
+ include "aws /lambda_ngx_apis.conf";
5
+ listen 80; # Use SSL/TLS in production
6
6
7
7
# Example of a proxy to one AWS Lambda Function URL.
8
8
location /bar {
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ services:
13
13
# dockerfile: ./docker/Dockerfile.plus
14
14
volumes :
15
15
- ../../examples/04-lambda-function-arn-and-url/:/etc/nginx/conf.d/
16
- - ../../core:/etc/nginx/lambda
16
+ - ../../core:/etc/nginx/aws
17
17
ports :
18
18
- " 80:80"
19
19
env_file :
Original file line number Diff line number Diff line change 1
- include "lambda /lambda_ngx_http.conf";
1
+ include "aws /lambda_ngx_http.conf";
2
2
3
3
server {
4
- include "lambda /lambda_ngx_apis.conf";
5
- listen 80;
4
+ include "aws /lambda_ngx_apis.conf";
5
+ listen 80; # Use SSL/TLS in production
6
6
7
7
# Example of a proxy to all of the AWS Lambda Function ARNs.
8
8
location / {
Original file line number Diff line number Diff line change 1
1
AWS_ACCESS_KEY_ID = ZZZZZZZZZZZZZZZZZZZZ
2
2
AWS_SECRET_ACCESS_KEY = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3
3
AWS_SESSION_TOKEN = bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
4
- DEBUG = true
4
+ DEBUG = false
5
5
HEADER_PREFIXES_TO_STRIP = false
6
6
LAMBDA_REGION = us-east-2
7
7
LAMBDA_SERVER_PROTO = https
You can’t perform that action at this time.
0 commit comments