Repository navigation
Expand file tree
/
Copy pathdefault.conf.template
More file actions
211 lines (163 loc) · 5.17 KB
/
Copy pathdefault.conf.template
File metadata and controls
211 lines (163 loc) · 5.17 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
resolver ${RESOLVER} valid=30s ipv6=off;
resolver_timeout 5s;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# Access log without client IP addresses (privacy statement, section 5.1;
# the CAU web server in front of this container may still log them):
# neither $remote_addr nor X-Forwarded-For is written.
log_format no_ip '[$time_local] "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
map $http_x_forwarded_proto $forwarded_proto {
default $http_x_forwarded_proto;
'' $scheme;
}
server {
listen 80;
server_name _;
access_log /var/log/nginx/access.log no_ip;
# Request errors (level error and lower) name the client IP, so log only critical ones.
error_log /var/log/nginx/error.log crit;
# Keep the public port for origin checks. Preserve TLS information from an
# outer reverse proxy; this container should only trust that proxy's headers.
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $forwarded_proto;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 300s;
client_max_body_size 100m;
# Compress the frontend bundle and the JSON responses of the backend services
# (text/html is always compressed). Event streams are not listed and stay
# uncompressed. gzip_proxied is needed because requests arriving through an
# outer reverse proxy would otherwise be excluded.
gzip on;
gzip_comp_level 5;
gzip_min_length 1024;
gzip_proxied any;
gzip_vary on;
gzip_types
application/javascript
application/json
application/manifest+json
application/wasm
image/svg+xml
text/css
text/javascript
text/plain;
# BEGIN code-analyzer
location /api/analysis {
set $upstream_code_analyzer ${CODE_ANALYZER_URL};
proxy_pass $upstream_code_analyzer;
# SSE settings
proxy_buffering off;
proxy_cache off;
chunked_transfer_encoding off;
}
# END code-analyzer
# BEGIN User-Service
location /user {
set $upstream_user ${USER_SERV_URL};
proxy_pass $upstream_user;
}
location /token {
set $upstream_token ${USER_SERV_URL};
proxy_pass $upstream_token;
}
location /snapshot {
set $upstream_snapshot ${USER_SERV_URL};
proxy_pass $upstream_snapshot;
}
# END User-Service
# BEGIN trace-service
location ~ ^/v3/landscapes/[^/]+/(?:communication|timestamps|trace-data|traces)(?:/.*|$) {
set $upstream_trace ${TRACE_SERV_URL};
proxy_pass $upstream_trace;
}
location ~ ^/v3/landscapes/[^/]+/spans(?:/.*|$) {
set $upstream_trace ${TRACE_SERV_URL};
proxy_pass $upstream_trace;
}
# END trace-service
# BEGIN metrics-service
location ~ ^/v3/landscapes/[^/]+/metrics(?:/.*|$) {
set $upstream_metrics ${METRICS_SERV_URL};
proxy_pass $upstream_metrics;
}
# END metrics-service
# BEGIN log-service
location ~ ^/v3/landscapes/[^/]+/(?:entities/[^/]+/)?logs(?:/.*|$) {
set $upstream_log ${LOG_SERV_URL};
proxy_pass $upstream_log;
}
location ~ ^/v3/landscapes/[^/]+/log-levels(?:/.*|$) {
set $upstream_log ${LOG_SERV_URL};
proxy_pass $upstream_log;
}
# END log-service
# BEGIN landscape-service
location /v3/landscapes {
set $upstream_landscape ${LANDSCAPE_SERV_URL};
proxy_pass $upstream_landscape;
}
# END landscape-service
# BEGIN VSCode
location ~ ^/(?:v2/ide|savepoints)(?:/|$) {
set $upstream_vscode ${VSCODE_SERV_URL};
proxy_pass $upstream_vscode;
}
# END VSCode
# BEGIN Chatbot
location /providers {
set $upstream_copilot_providers ${COPILOT_SERV_URL};
proxy_pass $upstream_copilot_providers;
}
location /copilot {
set $upstream_copilot ${COPILOT_SERV_URL};
proxy_pass $upstream_copilot;
proxy_buffering off;
proxy_cache off;
}
# END Chatbot
# BEGIN collaboration-service
# Prometheus scrapes /metrics inside the container network; keep it off the
# public host (case-insensitive, as the service's routes are).
location ~* ^/collaboration/metrics(?:/|$) {
return 404;
}
# Colyseus serves its matchmaking and WebSocket routes at the root, so strip
# the prefix. The service pings every few seconds, which keeps an idle room
# connection open; the long timeouts are a margin for slow links.
location /collaboration/ {
set $upstream_collaboration ${COLLAB_SERV_URL};
rewrite ^/collaboration/(.*)$ /$1 break;
proxy_pass $upstream_collaboration;
proxy_read_timeout 1h;
proxy_send_timeout 1h;
}
# END collaboration-service
# BEGIN Keycloak
location ~ ^/(?:realms|resources)(?:/|$) {
set $upstream_keycloak ${KEYCLOAK_URL};
proxy_pass $upstream_keycloak;
}
# END Keycloak
location = /runtime-config.js {
root /usr/share/nginx/html;
add_header Cache-Control "no-store";
}
location = /index.html {
root /usr/share/nginx/html;
add_header Cache-Control "no-cache";
}
# BEGIN Frontend
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
# END Frontend
}