diff --git a/admin_only/bco_api.conf b/admin_only/bco_api.conf index 9a533b3a..fad8896b 100644 --- a/admin_only/bco_api.conf +++ b/admin_only/bco_api.conf @@ -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; @@ -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; @@ -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; } }