Skip to content

Commit

Permalink
Update bco_api.conf
Browse files Browse the repository at this point in the history
Fix API regex for object retrieval
  • Loading branch information
HadleyKing authored Aug 30, 2021
1 parent 1b395c7 commit 0e7c1c0
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions admin_only/bco_api.conf
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
server {
listen 80;
server_name 161.253.252.155 portal.biochemistry.gwu.edu;
return 301 https://$host$request_uri;
}

server {

listen 443 ssl;
server_name 161.253.252.155 portal.biochemistry.gwu.edu;
ssl_certificate /etc/pki/tls/certs/bcoeditor.crt;
ssl_certificate_key /etc/pki/tls/private/bcoeditor.key;

# Biocompute API access
location /api/ {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://unix:/var/run/bco_api.sock;
}

# Portal users access
location /users/ {
proxy_set_header Host $http_host;
Expand All @@ -20,8 +24,19 @@ server {
proxy_pass http://127.0.0.1:8080;
}

# Biocompute API access
location /api/ {
# BCO API - Draft objects
#location ~* \/BCO_(\d+)\/(\d+)\.(\d+) {
location ~* ^/[a-zA-Z]+_DRAFT_(.*?) {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://unix:/var/run/bco_api.sock;
}

# BCO API - Published objects
#location ~* \/BCO_(\d+)\/(\d+)\.(\d+) {
location ~* ^/[a-zA-Z]+_(.*?) {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand All @@ -45,8 +60,8 @@ server {
}

# No error on missing favicon
location = /favicon.ico {
access_log off;
log_not_found off;
location = /favicon.ico {
access_log off;
log_not_found off;
}
}

0 comments on commit 0e7c1c0

Please sign in to comment.