ivmartel / dwv

DICOM Web Viewer: open source zero footprint medical image library.
https://ivmartel.github.io/dwv/
GNU General Public License v3.0
1.67k stars 593 forks source link

load dicom with DCM4CHEE and nginx #436

Closed kongdetai closed 6 years ago

kongdetai commented 6 years ago

I got the same error on #393 and #392
error massage: RequestError: An error occurred while reading 'flower.dcm' (http status: 0) [DicomDataLoader].

I got a local pasc server DCM4CHEE and I used it with DWV followed https://github.com/ivmartel/dwv-dcm4chee-web/wiki 1.the DCM4CHEE version is 2.18.1-mysql.

  1. dwv-dcm4chee-web version is v0.2.0.
  2. weasis-pacs-connector version is v5.0.1.
  3. dwv version 0.22.

the DCM4CHEE server port is 8080.

then I used nginx config:

server {
    listen       8800;
    server_name  localhost;
    location / {
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'POST';
        proxy_pass http://localhost:8080/;
    }
    location /api/ {
        proxy_pass http://localhost:8000/api/;
    }
}

then I visited http://localhost:8800/ goto DCM4CHEE normally, but I got error when I goto see the dicom on DWV:

RequestError: An error occurred while reading 'http://localhost:8080/wado?requestType=WADO&contentType=application/dicom&&studyUID=1.3.12.2.1107.5.2. 12.21149.201711231400005572759&seriesUID=1.3.12.2.1107.5.1.4.51667.3000001711170 0152609300227764&objectUID=1.3.12.2.1107.5.1.4.51667.300000171117001526093002280 97' (http status: 0).

How should I config it?

Looking forward for your reply!

Thank you very much!

ivmartel commented 6 years ago

Does the browser console give you more details on the error?

kongdetai commented 6 years ago

image

ivmartel commented 6 years ago

I would say that the access method is GET. Not sure if a more generic configuration such as the one suggested by enable-cors.org for nginx could help to.

kongdetai commented 6 years ago

Nginx could do this, I config successfully! Thank you for your help and wonderful job about DWV!

ivmartel commented 6 years ago

Could you share the config you used and what was the problem?

ivmartel commented 6 years ago

Closing for now. Feel free to comment if you can share the working config.

kongdetai commented 6 years ago

Sorry, These days so busy! The problem is some js file can not be load, but use 80 port can load these file!

server {
    listen      80;  //must be 80 port !
    server_name  your_domain;
    location / {
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Methods' 'POST';
        proxy_pass http://localhost:8080/;  //DCM4CHEE address
    }
    location /api/ {
        proxy_pass http://your API address:8080/api/;
    }
}
ivmartel commented 6 years ago

Thanks!