forked from berndtj/incubator-openwhisk-deploy-kube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
72 lines (60 loc) · 2.44 KB
/
nginx.conf
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
events {
worker_connections 4096;
}
http {
client_max_body_size 50M;
rewrite_log on;
log_format combined-upstream '$remote_addr - $remote_user [$time_local] '
'$request $status $body_bytes_sent '
'$http_referer $http_user_agent $upstream_addr';
access_log /logs/nginx_access.log combined-upstream;
upstream controllers {
# These addresses are for the controller. If there are more
# than two invoker instances deployed then you will need to
# add additional controller addresses.
server controller-0.controller.openwhisk:8080 fail_timeout=60s;
server controller-1.controller.openwhisk:8080 backup;
}
server {
listen 443 default ssl;
# match namespace, note while OpenWhisk allows a richer character set for a
# namespace, not all those characters are permitted in the (sub)domain name;
# if namespace does not match, no vanity URL rewriting takes place.
server_name ~^(?<namespace>[0-9a-zA-Z-]+)\.localhost$;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 10m;
ssl_certificate /etc/nginx/certs/tls.crt;
ssl_certificate_key /etc/nginx/certs/tls.key;
ssl_verify_client off;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers RC4:HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
proxy_ssl_session_reuse off;
# proxy to the web action path
location / {
if ($namespace) {
rewrite /(.*) /api/v1/web/${namespace}/$1 break;
}
proxy_pass http://controllers;
proxy_read_timeout 70s; # 60+10 additional seconds to allow controller to terminate request
}
# proxy to 'public/html' web action by convention
location = / {
if ($namespace) {
rewrite ^ /api/v1/web/${namespace}/public/index.html break;
}
proxy_pass http://controllers;
proxy_read_timeout 70s; # 60+10 additional seconds to allow controller to terminate request
}
location /blackbox-0.1.0.tar.gz {
root /etc/nginx;
}
location /OpenWhiskIOSStarterApp.zip {
return 301 https://github.com/openwhisk/openwhisk-client-swift/releases/download/0.2.3/starterapp-0.2.3.zip;
}
location /cli/go/download {
autoindex on;
root /etc/nginx;
}
}
}