1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
10 '[$time_local] "$http_x_request_id" $server_name $status $body_bytes_sent $request_time $request_method "$scheme://$http_host$request_uri" $remote_addr:$remote_port '
11 '"$http_referer" "$http_user_agent"';
12 access_log "{{ACCESSLOG}}" customlog;
13 client_body_temp_path "{{TMPDIR}}";
14 proxy_temp_path "{{TMPDIR}}";
15 fastcgi_temp_path "{{TMPDIR}}";
16 uwsgi_temp_path "{{TMPDIR}}";
17 scgi_temp_path "{{TMPDIR}}";
18 geo $external_client {
26 server {{UPSTREAMHOST}}:{{CONTROLLERPORT}};
29 listen {{LISTENHOST}}:{{CONTROLLERSSLPORT}} ssl;
30 server_name controller ~.*;
31 ssl_certificate "{{SSLCERT}}";
32 ssl_certificate_key "{{SSLKEY}}";
33 client_max_body_size 0;
35 proxy_pass http://controller;
36 proxy_set_header Upgrade $http_upgrade;
37 proxy_set_header Connection "upgrade";
38 proxy_set_header Host $http_host;
39 proxy_set_header X-External-Client $external_client;
40 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
41 proxy_set_header X-Forwarded-Proto https;
43 proxy_max_temp_file_size 0;
44 proxy_request_buffering off;
46 proxy_http_version 1.1;
50 server {{UPSTREAMHOST}}:{{KEEPPROXYPORT}};
53 listen {{LISTENHOST}}:{{KEEPPROXYSSLPORT}} ssl;
54 server_name keepproxy keep.*;
55 ssl_certificate "{{SSLCERT}}";
56 ssl_certificate_key "{{SSLKEY}}";
58 proxy_pass http://keepproxy;
59 proxy_set_header Host $http_host;
60 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
61 proxy_set_header X-Forwarded-Proto https;
64 client_max_body_size 67108864;
65 proxy_http_version 1.1;
66 proxy_request_buffering off;
70 server {{UPSTREAMHOST}}:{{KEEPWEBPORT}};
73 listen {{LISTENHOST}}:{{KEEPWEBSSLPORT}} ssl;
74 server_name keep-web collections.* ~\.collections\.;
75 ssl_certificate "{{SSLCERT}}";
76 ssl_certificate_key "{{SSLKEY}}";
78 proxy_pass http://keep-web;
79 proxy_set_header Host $http_host;
80 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
81 proxy_set_header X-Forwarded-Proto https;
84 client_max_body_size 0;
85 proxy_http_version 1.1;
86 proxy_request_buffering off;
90 server {{UPSTREAMHOST}}:{{HEALTHPORT}};
93 listen {{LISTENHOST}}:{{HEALTHSSLPORT}} ssl;
94 server_name health health.*;
95 ssl_certificate "{{SSLCERT}}";
96 ssl_certificate_key "{{SSLKEY}}";
98 proxy_pass http://health;
99 proxy_set_header Host $http_host;
100 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
101 proxy_set_header X-Forwarded-Proto https;
104 proxy_http_version 1.1;
105 proxy_request_buffering off;
109 listen {{LISTENHOST}}:{{KEEPWEBDLSSLPORT}} ssl;
110 server_name keep-web-dl download.* ~.*;
111 ssl_certificate "{{SSLCERT}}";
112 ssl_certificate_key "{{SSLKEY}}";
114 proxy_pass http://keep-web;
115 proxy_set_header Host $http_host;
116 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
117 proxy_set_header X-Forwarded-Proto https;
120 client_max_body_size 0;
121 proxy_http_version 1.1;
122 proxy_request_buffering off;
126 server {{UPSTREAMHOST}}:{{WSPORT}};
129 listen {{LISTENHOST}}:{{WSSSLPORT}} ssl;
130 server_name websocket ws.*;
131 ssl_certificate "{{SSLCERT}}";
132 ssl_certificate_key "{{SSLKEY}}";
134 proxy_pass http://ws;
135 proxy_set_header Upgrade $http_upgrade;
136 proxy_set_header Connection "upgrade";
137 proxy_set_header Host $http_host;
138 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
139 proxy_set_header X-Forwarded-Proto https;
142 client_max_body_size 0;
143 proxy_http_version 1.1;
144 proxy_request_buffering off;
147 # wb1->wb2 redirects copied from
148 # /tools/salt-install/config_examples/multi_host/aws/pillars/nginx_workbench_configuration.sls
149 map $request_uri $wb1_redirect {
152 ~^/actions\?uuid=(.*-4zz18-.*) /collections/$1;
153 ~^/actions\?uuid=(.*-j7d0g-.*) /projects/$1;
154 ~^/actions\?uuid=(.*-tpzed-.*) /projects/$1;
155 ~^/actions\?uuid=(.*-7fd4e-.*) /workflows/$1;
156 ~^/actions\?uuid=(.*-xvhdp-.*) /processes/$1;
157 ~^/actions\?uuid=(.*) /;
159 ^/work_units/(.*) /processes/$1;
160 ^/container_requests/(.*) /processes/$1;
161 ^/users/(.*) /user/$1;
162 ^/groups/(.*) /group/$1;
164 ^/virtual_machines.* /virtual-machines-admin;
165 ^/users/.*/virtual_machines /virtual-machines-user;
166 ^/authorized_keys.* /ssh-keys-admin;
167 ^/users/.*/ssh_keys /ssh-keys-user;
168 ^/containers.* /all_processes;
169 ^/container_requests /all_processes;
170 ^/job.* /all_processes;
171 ^/users/link_account /link_account;
172 ^/keep_services.* /keep-services;
173 ^/trash_items.* /trash;
177 ^/user_agreements.* /;
187 ^/uploaded_datasets.* /;
189 ^/pipeline_templates.* /;
190 ^/pipeline_instances.* /;
192 upstream workbench2 {
193 server {{UPSTREAMHOST}}:{{WORKBENCH2PORT}};
196 listen {{LISTENHOST}}:{{WORKBENCH2SSLPORT}} ssl;
197 listen {{LISTENHOST}}:{{WORKBENCH1SSLPORT}} ssl;
198 server_name workbench2 workbench2.* workbench1 workbench1.* workbench workbench.*;
199 ssl_certificate "{{SSLCERT}}";
200 ssl_certificate_key "{{SSLKEY}}";
203 return 301 $wb1_redirect;
206 # file download redirects
207 if ($arg_disposition = attachment) {
208 rewrite ^/collections/([^/]*)/(.*) /?redirectToDownload=/c=$1/$2? redirect;
210 if ($arg_disposition = inline) {
211 rewrite ^/collections/([^/]*)/(.*) /?redirectToPreview=/c=$1/$2? redirect;
215 proxy_pass http://workbench2;
216 proxy_set_header Host $http_host;
217 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
218 proxy_set_header X-Forwarded-Proto https;