This repository was archived by the owner on Jul 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlocations.conf
More file actions
175 lines (133 loc) · 5.9 KB
/
locations.conf
File metadata and controls
175 lines (133 loc) · 5.9 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
error_page 490 = @kheopsAuthorization;
error_page 491 = @kheopsDICOMwebProxy;
error_page 492 = @kheopsZipper;
location /api {
return 490; #kheopsAuthorization
}
# If we hit /studies exactly, we are dealing with a study level QIDO or STOW
location = /api/studies {
if ( $request_method = GET ) { return 490; } #kheopsAuthorization
if ( $request_method = OPTIONS ) { return 490; } #kheopsAuthorization
if ( $request_method = POST ) { return 491; } #kheopsDICOMwebProxy
}
# Anything with users is for the authorization server
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+)/users {
return 490; #kheopsAuthorization
}
# Anything with albums is for the authorization server
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+)/albums {
return 490; #kheopsAuthorization
}
# Instances goes to the DICOMWebProxy
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+)/instances$ {
return 491; #kheopsDICOMwebProxy
}
# Instances goes to the DICOMWebProxy
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+)/instances/([0-9.]+)$ {
return 491; #kheopsDICOMwebProxy
}
# Frames goes to the DICOMWebProxy
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+)/instances/([0-9.]+)/frames/([0-9]+)$ {
return 491; #kheopsDICOMwebProxy
}
# Metadata goes to the DICOMWebProxy
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+)/metadata$ {
return 491; #kheopsDICOMwebProxy
}
# Bulkdata goes to the DICOMWebProxy
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+)/bulkdata/([a-fA-F0-9]+)$ {
return 491; #kheopsDICOMwebProxy
}
# Metadata goes to the DICOMWebProxy
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+)/instances/([0-9.]+)/metadata$ {
return 491; #kheopsDICOMwebProxy
}
# Dulkdata goes to the DICOMWebProxy
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+)/instances/([0-9.]+)/bulkdata/([a-fA-F0-9]+)$ {
return 491; #kheopsDICOMwebProxy
}
# Thumbnail (series) goes to the DICOMWebProxy
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+)/thumbnail$ {
return 491; #kheopsDICOMwebProxy
}
# Thumbnail (instance) goes to the DICOMWebProxy
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+)/instances/([0-9.]+)/thumbnail$ {
return 491; #kheopsDICOMwebProxy
}
# WADO and QIDO is for the dicomwebproxy, PUT and DELETE on the series is for the authorization server
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+) {
if ( $request_method = GET ) { return 491; } #kheopsDICOMwebProxy
if ( $request_method != GET ) { return 490; } #kheopsAuthorization
}
# series level QIDO is for the authorization server
location ~ ^/api/studies/([0-9.]+)/series$ {
return 490; #kheopsAuthorization
}
# study level metadata requests are handled by the authorization server
location ~ ^/api/studies/([0-9.]+)/metadata$ {
return 490; #kheopsAuthorization
}
# study level OHIF metadata requests are handled by the DICOMweb proxy
location ~ ^/api/studies/([0-9.]+)/ohifmetadata$ {
return 491; #kheopsDICOMwebProxy
}
# series level instance QIDO requests are handled by the DICOMweb proxy
location ~ ^/api/studies/([0-9.]+)/instances$ {
return 491; #kheopsDICOMwebProxy
}
# Anything with users is for the authorization server
location ~ ^/api/studies/([0-9.]+)/users {
return 490; #kheopsAuthorization
}
# Anything with albums is for the authorization server
location ~ ^/api/studies/([0-9.]+)/albums {
return 490; #kheopsAuthorization
}
# Anything with comments is for the authorization server
location ~ ^/api/studies/([0-9.]+)/comments {
return 490; #kheopsAuthorization
}
# Anything with favorites is for the authorization server
location ~ ^/api/studies/([0-9.]+)/favorites {
return 490; #kheopsAuthorization
}
# Anything with favorites is for the authorization server
location ~ ^/api/studies/([0-9.]+)/series/([0-9.]+)/favorites {
return 490; #kheopsAuthorization
}
# STOW and WADO are for the kheopsDICOMwebProxy, ZIP is for the kheopsZipper, deleting a study or appropriate is for kheopsAuthorization
location ~ ^/api/studies/[0-9.]+$ {
if ( $request_method = PUT ) { return 490; } #kheopsAuthorization
if ( $request_method = DELETE ) { return 490; } #kheopsAuthorization
if ( $request_method = OPTIONS ) { return 490; } #kheopsAuthorization
if ($http_accept ~ "application/zip") { return 492; } #kheopsZipper
if ($arg_accept ~ "application/zip") { return 492; } #kheopsZipper
if ($arg_accept ~ "application%2Fzip") { return 492; } #kheopsZipper
return 491; #kheopsDICOMwebProxy
}
location /api/wado {
proxy_set_header Connection "";
if ( $arg_requestType = "WADO" ) { return 491; } #kheopsDICOMwebProxy
return 400 "requestType must be WADO";
}
location /api/ohifservermetadata {
return 491; #kheopsDICOMwebProxy
}
location @kheopsAuthorization {
rewrite ^/api(.*)$ /authorization$1 break;
# Fix the “It appears that your reverse proxy set up is broken" error.
proxy_pass ${kheopsAuthorization_url};
proxy_redirect ${kheopsAuthorization_url} ${root_url};
}
location @kheopsDICOMwebProxy {
rewrite ^/api(.*)$ /capabilities/password/dicomweb$1 break;
# Fix the “It appears that your reverse proxy set up is broken" error.
proxy_pass http://dicomweb_proxy;
proxy_redirect http://dicomweb_proxy ${root_url};
}
location @kheopsZipper {
rewrite ^/api(.*)$ /zipper$1 break;
# Fix the “It appears that your reverse proxy set up is broken" error.
proxy_pass ${kheopsZipper_url};
proxy_redirect ${kheopsZipper_url} ${root_url};
}