-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf.template
More file actions
89 lines (68 loc) · 2.76 KB
/
Copy pathnginx.conf.template
File metadata and controls
89 lines (68 loc) · 2.76 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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
events {
}
http {
upstream runs_GET {
server ${WF_API_HOST};
}
upstream runs_POST {
server ${WF_API_HOST};
}
upstream runs_OPTIONS {
server ${WF_API_HOST};
}
upstream wfapi {
server ${WF_API_HOST};
}
upstream ui {
server ${WF_UI_HOST};
}
server {
listen ${PORT};
location / {
proxy_pass http://ui;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /graphql {
proxy_pass http://wfapi/graphql;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api-docs/ {
# rewrites are needed for the springfox swagger html to fetch its resources correctly
rewrite ^/api-docs/v2/api-docs?$ /v2/api-docs break;
rewrite ^/api-docs/swagger-resources(/.*)?$ /swagger-resources$1 break;
rewrite ^/api-docs/(.*)?$ /swagger-ui/$1 break;
# sub_fitlers written while workflow-api is on `springfox.version=3.0.0`
sub_filter_types application/javascript application/json;
# updates regex in springfox.js so html can load properly
sub_filter ')\/swagger-ui(' ')\/(';
# updates base path in api-def so requests route to /api
sub_filter '"/"' '"/api/v1"';
proxy_pass http://wfapi/;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/service-info {
proxy_pass http://wfapi/service-info;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/v1/runs {
rewrite ^/api/v1/runs(/.*)? /runs$1 break;
proxy_pass http://runs_$request_method;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}