I am using a dicom viewer which is based on NODEJ with Express
Https://www.npmjs.com/package/cornerstone-wado-image-loader
And in its documentation says the following
Note that the web server must support Cross source resource sharing or the image will fail to load. If you are unable to get CORS enabled on the web server you are loading DICOM P10 instances from, you can use a reverse proxy. Here's a simple Node.js based on http-proxy that adds CORS headers that you might find useful.
And to solve this intale NGIX to enable the CORS, the problem is that my application in NODE (the DICOm viewer) is in port 3000 and the service of WADO of dcm3che that is the provider of DICOM is in port 8080 is by That the browser shows me this error at the time of obtaining the dicom
XMLHttpRequest can not load http: // localhost: 8080 / wado? RequestType = WADO & studyUID = 1.2.840.113704.1.111.5 ... 26513.429 & contentType = application% 2Fdicom & transferSyntax = 1.2.840.10008.1.2. In 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http: // localhost' is therefore not allowed access.
And that's why I install the NGINX to solve the problem, I'm following an example of another view where it shows how to enable the CORS in NGINX I'm also using the reverse proxy to get the DICOM since I can not edit and enable CORS port 8080 , I leave my NGINX configuration code
Server {
Listen 80;
Server_name localhost;
Location / {
Proxy_pass http: // localhost: 3000;
Proxy_http_version 1.1;
Proxy_set_header Upgrade $ http_upgrade;
Proxy_set_header Connection 'upgrade';
Proxy_set_header Host $ host;
Proxy_cache_bypass $ http_upgrade;
Add_header 'Access-Control-Allow-Credentials' 'true';
Access-Control-Allow-Headers '' DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, C $
Add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
Add_header 'Access-Control-Allow-Origin' '*';
}
Location / app2 {
Proxy_pass http: // localhost: 8080;
Proxy_http_version 1.1;
Proxy_set_header Upgrade $ http_upgrade;
Proxy_set_header Connection 'upgrade';
Proxy_set_header Host $ host;
Proxy_cache_bypass $ http_upgrade;
Add_header 'Access-Control-Allow-Credentials' 'true';
Access-Control-Allow-Headers '' DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, C $
Add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
Add_header 'Access-Control-Allow-Origin' '*';
}
}
I base this this example http://book.orthanc-server.com/faq/nginx.html Where it is supposed that the problem should be solved but my navador continues showing this
XMLHttpRequest can not load http: // localhost: 8080 / wado? RequestType = WADO & studyUID = 1.2.840.113704.1.111.5 ... 26513.429 & contentType = application% 2Fdicom & transferSyntax = 1.2.840.10008.1.2. In 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http: // localhost' is therefore not allowed access.
And returning this
HEADER RESPONSE
Content-Type: application / dicom
Date: Sat, 01 Apr 2017 01:15:38 GMT
Expires: 0
Server: Apache-Coyote / 1.1
Transfer-Encoding: chunked
X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag = JBoss_4_2_3_GA
Date = 200807181439) /JBossWeb-2.0
REQUEST HEADER
Accept: * / *
Accept-Encoding: gzip, deflate, sdch, br
Accept-Language: en-US, en, q = 0.8, en-US; q = 0.6, en; q = 0.4
Connection: keep-alive
Host: localhost: 8080
Origin: http: // localhost: 3000
Referer: http: // localhost: 3000 /
User-Agent: Mozilla / 5.0 (X11; Linux x86_64) AppleWebKit / 537.36 (KHTML, like
Gecko) Chrome / 55.0.2883.87 Safari / 537.36
How do I enable the CORS of dcm4chee port 8080 is supposed that the solution was to use reserved proxy, which was doing wrong?
sorry for my English
via M. Node
No comments:
Post a Comment