ragu1257 2021-05-28 18:10 采纳率: 0%
浏览 27

Trouble in loading data from local Orthanc server

I want to get the data from my local Orthanc server but getting a proxy error:

image

My default.js file looks like this:

image

I am using Nginx to proxy-pass the Orthanc-server:

image

When I am going to this url http://localhost/orthanc/dicom-web/studies I am able to see an array object of studies.

While searching for my problem, I saw a solution to make a change in orthanc.json file for DicomWeb, so I also updated my orthanc.json file:

image

I am not sure where am I going wrong.
When I am running the project with yarn run dev:orthanc, it is working fine.
Can you please suggest me correct way of rendering the data from my local Orthanc server?

  • 写回答

1条回答 默认 最新

  • 哎呀呀不会啊 2024-05-29 15:10
    关注

    Based on the information you've provided, it seems like you're encountering a CORS (Cross-Origin Resource Sharing) issue. This issue arises when a web application makes a request to a different domain than the one it originated from. In your case, it seems like your Nginx server is set up to proxy requests to your Orthanc server, but the CORS policy is not allowing the request to be made.

    To resolve this issue, you can add the following lines to your Nginx configuration file:

    location /orthanc/ {
        proxy_pass http://localhost:8042/;
        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-Origin' '*';
        add_header 'Access-Control-Allow-Credentials' 'true';
        add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE';
    }
    

    This configuration will allow your Nginx server to accept requests from any origin, and it will include the necessary headers in the response to enable CORS.

    After making these changes, remember to restart your Nginx server for the changes to take effect.

    If you're still encountering issues, you might want to check the Orthanc server logs for any error messages that could provide more insight into the problem.

    评论

报告相同问题?

悬赏问题

  • ¥200 如何使用postGis实现最短领规划?
  • ¥15 pyinstaller打包错误
  • ¥20 cesm的气溶胶排放文件
  • ¥15 逐月累计,月份不连续,补齐月份
  • ¥15 应用简单的Python代码完成一个学生成绩管理系统
  • ¥15 用matlab求微分方程初值问题
  • ¥15 vscode下编写第三方库opencv与pcl代码时没有代码提示
  • ¥15 能够跑通不报错,如何解决?(标签-matlab)
  • ¥15 MOS在RDS较大,频率高时开关波形异常
  • ¥15 SCENIC分析报错求解答