Skip to content

Commit 0e7c1c0

Browse files
authored
Update bco_api.conf
Fix API regex for object retrieval
1 parent 1b395c7 commit 0e7c1c0

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

admin_only/bco_api.conf

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
server {
2-
listen 80;
3-
server_name 161.253.252.155 portal.biochemistry.gwu.edu;
4-
return 301 https://$host$request_uri;
5-
}
61

72
server {
8-
3+
94
listen 443 ssl;
105
server_name 161.253.252.155 portal.biochemistry.gwu.edu;
116
ssl_certificate /etc/pki/tls/certs/bcoeditor.crt;
127
ssl_certificate_key /etc/pki/tls/private/bcoeditor.key;
138

9+
# Biocompute API access
10+
location /api/ {
11+
proxy_set_header Host $http_host;
12+
proxy_set_header X-Real-IP $remote_addr;
13+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
14+
proxy_set_header X-Forwarded-Proto $scheme;
15+
proxy_pass http://unix:/var/run/bco_api.sock;
16+
}
17+
1418
# Portal users access
1519
location /users/ {
1620
proxy_set_header Host $http_host;
@@ -20,8 +24,19 @@ server {
2024
proxy_pass http://127.0.0.1:8080;
2125
}
2226

23-
# Biocompute API access
24-
location /api/ {
27+
# BCO API - Draft objects
28+
#location ~* \/BCO_(\d+)\/(\d+)\.(\d+) {
29+
location ~* ^/[a-zA-Z]+_DRAFT_(.*?) {
30+
proxy_set_header Host $http_host;
31+
proxy_set_header X-Real-IP $remote_addr;
32+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
33+
proxy_set_header X-Forwarded-Proto $scheme;
34+
proxy_pass http://unix:/var/run/bco_api.sock;
35+
}
36+
37+
# BCO API - Published objects
38+
#location ~* \/BCO_(\d+)\/(\d+)\.(\d+) {
39+
location ~* ^/[a-zA-Z]+_(.*?) {
2540
proxy_set_header Host $http_host;
2641
proxy_set_header X-Real-IP $remote_addr;
2742
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -45,8 +60,8 @@ server {
4560
}
4661

4762
# No error on missing favicon
48-
location = /favicon.ico {
49-
access_log off;
50-
log_not_found off;
63+
location = /favicon.ico {
64+
access_log off;
65+
log_not_found off;
5166
}
5267
}

0 commit comments

Comments
 (0)