From e3426a257ecd4470017ba069e67a331a210f771e Mon Sep 17 00:00:00 2001 From: Victor Kofia Date: Sat, 25 Aug 2018 23:47:50 -0400 Subject: [PATCH] Set up nginx as reverse proxy for Orthanc. (#1813) - adds CORS headers to all requests coming from Orthanc. --- contrib/util/docker/dockers/dev-nginx/nginx.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/contrib/util/docker/dockers/dev-nginx/nginx.conf b/contrib/util/docker/dockers/dev-nginx/nginx.conf index a44ba8892..224df1c2f 100644 --- a/contrib/util/docker/dockers/dev-nginx/nginx.conf +++ b/contrib/util/docker/dockers/dev-nginx/nginx.conf @@ -119,6 +119,18 @@ http { } # end globals.conf configuration file. + # enable CORS for orthanc dicom server + location /orthanc/ { + proxy_pass http://localhost:8042; + proxy_set_header HOST $host; + proxy_set_header X-Real-IP $remote_addr; + rewrite /orthanc(.*) $1 break; + add_header 'Access-Control-Allow-Credentials' 'true'; + add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + add_header 'Access-Control-Allow-Origin' '*'; + } + # deny access to writable files/directories location ~* ^/sites/*/(documents|edi|era) { deny all; -- 2.11.4.GIT