forked from coopernurse/nginx-s3-proxy
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathproxy.tmpl
More file actions
38 lines (28 loc) · 1.04 KB
/
Copy pathproxy.tmpl
File metadata and controls
38 lines (28 loc) · 1.04 KB
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
31
32
33
34
35
36
37
38
proxy_cache_lock on;
proxy_cache_lock_timeout 60s;
proxy_cache_path /data/cache levels=1:2 keys_zone=s3cache:10m inactive={{ getenv "CACHE_TIME" }} max_size={{ getenv "CACHE_SIZE" }};
server {
server_name {{ getenv "SERVER_NAME" }};
listen 80;
gzip_min_length 2000;
gzip_proxied any;
proxy_read_timeout 60s;
client_max_body_size 1M;
location = / {
return 302 https://about.commonsearch.org/;
}
location / {
#if ($scheme = "http") {
# rewrite ^ https://$server_name$request_uri? permanent;
#}
proxy_pass https://{{ getenv "S3_BUCKET" }}.s3-{{ getenv "REGION" }}.amazonaws.com;
aws_access_key {{ getenv "AWS_ACCESS_KEY_ID" }};
aws_secret_key {{ getenv "AWS_SECRET_ACCESS_KEY" }};
s3_bucket {{ getenv "S3_BUCKET" }};
proxy_set_header Authorization $s3_auth_token;
proxy_set_header x-amz-date $aws_date;
proxy_cache s3cache;
proxy_cache_valid 200 {{ getenv "CACHE_TIME" }};
}
access_log /dev/stdout main;
}