-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnginx.conf.gotempl
50 lines (38 loc) · 1.08 KB
/
nginx.conf.gotempl
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
39
40
41
42
43
44
45
46
47
48
49
50
server {
listen {{ .Port }};
server_name _;
# send precompressed files with the “.gz” filename extension instead of regular files
gzip_static on;
client_max_body_size 0;
root {{ .Root }};
location / {
try_files $uri $uri/ /index.html;
}
location = /swagger.json {
proxy_pass {{ .ManagementEndpoint }}/swagger.json;
}
location /api {
proxy_pass {{ .ManagementEndpoint }};
}
{{ .AdditionalLocations }}
location /s3 {
resolver {{ .DNSAddress }};
{{ .AdditionalS3LocationsRules }}
set_by_lua_block $urlencore_proxy_uri {
local uri = ngx.var.request_uri
local proxy_uri = ngx.re.gsub(uri, "^/s3", "")
local encoded_uri = ngx.re.gsub(proxy_uri, "\\+", "%2B", "jo")
return encoded_uri
}
proxy_pass {{ .S3Endpoint }}$urlencore_proxy_uri;
proxy_redirect off;
}
location /iam {
proxy_pass {{ .IAMEndpoint }};
}
location /sts {
proxy_pass {{ .STSEndpoint }};
proxy_set_header host $host;
proxy_set_header proxy_path /sts;
}
}