Error CORS using Proxy Reverse

Hi, I’m trying to connect a Node project (Typescript) with Orthanc Server for using DICOMweb client but I am finding a CORS error (Access to XMLHttpRequest has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource) and I configured a proxy reverse but not working…

Inside file “/etc/nginx/sites-available/default” I inserted this code:

server_name 192.168.0.234:3000; # Direction Node

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
proxy_pass http://localhost:8042/; #Direction Orthanc Server
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';

}

Anybody can help me? Thanks.

Hello,

Your question is more related to nginx than to Orthanc. However, there is a section about CORS in the Orthanc Book.

Kind Regards,
Sébastien-